Advertisement
dllbridge

Untitled

Jul 9th, 2024
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.41 KB | None | 0 0
  1.  
  2. #include    <stdio.h>
  3. #include   <string.h>
  4.  
  5.  
  6. char sz[99] = "SONY_";
  7.  
  8.  
  9. int _strlen(const char *psz);  
  10.  
  11. ////////////////////////////////////////////////////
  12. int main()                                        //
  13. {
  14.  
  15.  
  16.  
  17.     strcat(sz, "Pictures");
  18.    
  19.     printf("%s \n", sz);
  20.    
  21.     printf("%d\n", strlen("TDK"));
  22. }
  23.  
  24.  
  25.  
  26. ////////////////////////////////////////////////////
  27. int _strlen(const char *psz)                      //
  28. {
  29.        
  30.      int nRes = 0;      
  31.        
  32.        
  33.        
  34. return nRes;        
  35. }
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. /*
  61.  
  62. #include   <stdio.h>
  63. #include  <string.h>
  64.  
  65. struct T
  66. {
  67.  
  68.     int  n;
  69.     char c;
  70.    
  71.     char  sz[34];
  72.    
  73. }t1, t2;
  74.  
  75.  
  76.  
  77. struct T t3;
  78.  
  79.  
  80. void foo(struct T *p);  
  81.  
  82. ////////////////////////////////////////////////////
  83. int main()                                        //
  84. {
  85.  
  86.  
  87.    struct  T t4, t5;
  88.    
  89.    
  90.    t4.n =  1333;
  91.    t4.c = 'F';
  92.    
  93.    strcpy(t4.sz, "SONY");
  94.    
  95.    foo(&t5);
  96.  
  97. }
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105. /////////////////////////////////////////////////////
  106. void foo(struct T *p)                              //
  107. {
  108.        
  109.      printf("p->n  = %d \n", p->n );  
  110.      printf("p->c  = %d \n", p->c );  
  111.      printf("p->sz = %s \n", p->sz);      
  112. }
  113.  
  114.  
  115.  
  116. */
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125. /*
  126.  
  127. #include  <stdio.h>
  128.  
  129.  
  130.  
  131.  
  132. int  n =  72;
  133.  
  134. char c =  72;
  135.  
  136.  
  137. ////////////////////////////////////////////////////
  138. int main()                                        //
  139. {
  140.  
  141.  
  142.            
  143.         if(n ==  5) { printf("May     \n");  goto L_01;  }
  144.         if(n ==  6) { printf("June    \n");  goto L_01;  }
  145.         if(n == 70) { printf("SONY 70 \n");  goto L_01;  }
  146.                    
  147.                  
  148.         printf("Error !!! \n");                  
  149. L_01:   printf("c = %c \n", c);    
  150.  
  151. }
  152.  
  153.  
  154.  
  155. */
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171. /*
  172. #include  <stdio.h>
  173.  
  174.  
  175.  
  176.  
  177. int  n = 5;
  178.  
  179. char c = 70;
  180.  
  181.  
  182. ////////////////////////////////////////////////////
  183. int main()                                        //
  184. {
  185.  
  186.     switch(c)
  187.     {
  188.            
  189.         case  5: printf("May \n");
  190.                  break;    
  191.  
  192.         case  6: printf("June \n");
  193.                  break;                
  194.  
  195.         case 70: printf("SONY 70 \n");
  196.                  break;            
  197.                  
  198.         default: printf("Error !!! \n");            
  199.     }
  200.    
  201.     printf("c = %c \n", c);    
  202.  
  203. }
  204.  
  205.  
  206.  
  207. */
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement