Advertisement
dllbridge

Untitled

Aug 20th, 2024
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.65 KB | None | 0 0
  1.  
  2. #include  <stdio.h>
  3.  
  4.  
  5.  
  6. //////////////////////////////////////////////////
  7. int main()                                      //  
  8. {
  9.      
  10.     char sz[9] = "SONY",      
  11.          
  12.         *p     = &sz[1];
  13.        
  14.     printf("%s\n", (p -1));  
  15.     printf("%s\n", &p[-1]);
  16.      
  17.     printf("%s\n", &(*(&(&p[-1])[0])));      
  18. }
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. /*
  55. #include  <stdio.h>
  56.  
  57.  
  58.  
  59. //////////////////////////////////////////////////
  60. int main()                                      //  
  61. {
  62.                                                
  63.     char sz1[9] = "SONY";  
  64.     char sz2[9] = {115, 49, 'N', 'Y'};      
  65.    
  66.     printf(sz1 );
  67.     printf(sz2 );    
  68.     printf("\n");  
  69.     printf("sz2 = %s, %d\n", sz2, 646);    
  70.     printf("sz1 = %s\n", sz1);                                      
  71. }
  72.  
  73.  
  74.  
  75. */
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92. /*
  93. #include<iostream>
  94. using namespace std;
  95.  
  96.  
  97. //////////////////////////////////////////////////
  98. int main()                                      //  
  99. {
  100.          
  101.     int nArr[] = {20, 33, 22, 23},              //   kljklj
  102.        *p      =  nArr,
  103.         i      =  0   ;                                    // kljlkjlj
  104.        
  105. L_01:              
  106.         cout <<   p[i] << "  ";
  107.         cout <<   p+i  << endl;
  108.    
  109.         if(i < 4) { i++; goto L_01; }
  110.    
  111.         cout << "&i = " << &i << endl;
  112.         cout << " i = " <<  i << endl;
  113. return 0;
  114. }
  115.  
  116. */
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. /*
  141.  
  142. #include<iostream>
  143. using namespace std;
  144.  
  145.  
  146. //////////////////////////////////////////////////
  147. int main()                                      //  
  148. {
  149.          
  150.     int nArr[] = {20, 333, 22, 23},              //   kljklj
  151.        *p      =  nArr;                                  // kljlkjlj
  152.    
  153.     for(int i=0; i<4; i++)
  154.     {
  155.         cout <<   p[i] << "  ";
  156.         cout <<   p+i  << endl;
  157.     }
  158.  
  159. return 0;
  160. }
  161.  
  162.  
  163.  
  164.  
  165.  
  166. */
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187. /*
  188. #include<iostream>
  189. using namespace std;
  190.  
  191.  
  192.  
  193. int main()
  194. {
  195.          
  196.     int nArr[] = {20, 21, 22, 23},              //   kljklj
  197.        *p=nArr;                                 // kljlkjlj
  198.    
  199.     for(int i=0; i<4; i++)
  200.     {
  201.         cout << *(p+i) << "  ";
  202.         cout <<   p+i  << endl;
  203.     }
  204.  
  205. return 0;
  206. }
  207.  
  208.  
  209. */
  210.  
  211.  
  212.  
  213. /*
  214.  
  215. #include<iostream>
  216. using namespace std;
  217.  
  218.  
  219.  
  220. int main()
  221. {
  222.          
  223.     int nArr[] = {20, 21, 22, 23},              //   kljklj
  224.        *p=nArr;                                 // kljlkjlj
  225.    
  226.     for(int i=0; i<4; i++)
  227.     {
  228.         cout << *(p+i) << "  ";
  229.         cout << &i     << endl;
  230.     }
  231.  
  232. return 0;
  233. }
  234.  
  235.  
  236.  
  237. */
  238.  
  239.  
  240.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement