Advertisement
dllbridge

Untitled

Jan 21st, 2024
693
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.90 KB | None | 0 0
  1.  
  2.  
  3. #include    <stdio.h>
  4. #include   <string.h>
  5.  
  6. void _strcpy(char *p1, const char *p2);
  7.  
  8. char sz [99] = "SONY Pictures = ",
  9.      sz2[99] = {'S', 'O', 'N'};  
  10.      
  11. int nArr[66] = {71, 1, 2};    
  12.  
  13. ///////////////////////////////////////////////
  14. int main()                                   //
  15. {
  16.    
  17.    _strcpy(sz, "sz2");
  18.      
  19.     printf(" sz = %s\n", sz);
  20. }
  21.  
  22.  
  23.  
  24.  
  25. void _strcpy(char *p1, const char *p2)
  26. {
  27.    
  28.    
  29. }
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. /*
  49. #include   <stdio.h>
  50.  
  51. int x_foo(char *p);  
  52.  
  53. char sz [99] = "SONY Picture",
  54.      sz2[99] = {'S', 'O', 'N'};  
  55.      
  56. int nArr[66] = {71, 1, 2};    
  57.  
  58. ///////////////////////////////////////////////
  59. int main()                                   //
  60. {
  61.    
  62.     printf("Len of sz = %d\n", x_foo(sz2) );
  63.    
  64. }
  65.  
  66.  
  67.  
  68. ///////////////////////////////////////////////
  69. int x_foo(char *p)                           //  
  70. {
  71.    
  72.     int i = 0;
  73.    
  74.     while(p[i++] != 0);
  75.  
  76.    
  77. return i-1;
  78. }
  79.  
  80.  
  81.  
  82. */
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. /*
  96. #include   <stdio.h>
  97.  
  98. int x_foo(char *p);  
  99.  
  100. char sz [99] = "SONY Pictures",
  101.      sz2[99] = {'S', 'O', 'N'};  
  102.      
  103. int nArr[66] = {71, 1, 2};    
  104.  
  105. ///////////////////////////////////////////////
  106. int main()                                   //
  107. {
  108.    
  109.     printf("Len of sz = %d\n", x_foo(sz) );
  110.    
  111. }
  112.  
  113.  
  114.  
  115. ///////////////////////////////////////////////
  116. int x_foo(char *p)                           //  
  117. {
  118.    
  119.     int i = 0;
  120.    
  121.     for( ; i < 10000; i++)
  122.     {
  123.        
  124.        
  125.        if( p[i] == 0) break;   
  126.        
  127.     }
  128.    
  129.    
  130. return i;  
  131. }
  132.  
  133. */
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156. /*
  157.  
  158. #include   <stdio.h>
  159.  
  160.  
  161.  
  162. char sz [99] = "SONY Pictures",
  163.      sz2[99] = {'S', 'O', 'N'};  
  164.      
  165. int nArr[66] = {71, 1, 2};    
  166.  
  167. ///////////////////////////////////////////////
  168. int main()                                   //
  169. {
  170.    
  171.     sz2[4] = 4;
  172.     sz2[5] = 5;
  173.     sz2[4] += sz2[5];
  174.    
  175.     printf("sz2[4] = %d \n", sz2[4]);
  176. }
  177.  
  178.  
  179.  
  180.  
  181. */
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement