Advertisement
dllbridge

Untitled

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