Advertisement
dllbridge

Untitled

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