Advertisement
dllbridge

Untitled

Mar 14th, 2024
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.23 KB | None | 0 0
  1.  
  2.  
  3.  
  4. #include  <stdio.h>
  5. #include <string.h>
  6.  
  7.                                                                                                                                                                   //  opipoipo
  8.  
  9.  
  10. void foo(char *p);  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. ////////////////////////////////////////////////////
  17. int main()                                        //  
  18. {
  19.    
  20.     char sz[99];
  21.     strcpy(sz, "SONY Pictures");
  22.     char c = '0';
  23.    
  24.    
  25.     foo(&sz[7]);
  26. }
  27.  
  28.  
  29.  
  30.  
  31. ////////////////////////////////////////////////////
  32. void foo(char *p)                                 //
  33. {
  34.    
  35.      p = p - 7;
  36.    
  37.      
  38.      p[8] = 87;
  39.      
  40.      printf("p = %s\n",  p);     
  41. }
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. /*
  54.  
  55. #include  <stdio.h>
  56. #include <string.h>
  57.  
  58.                                                                                                                                                                   //  opipoipo
  59.  
  60.  
  61. void foo(char *p);  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. ////////////////////////////////////////////////////
  68. int main()                                        //  
  69. {
  70.    
  71.     char sz[99];
  72.     strcpy(sz, "SONY Pictures");
  73.     char c = '0';
  74.    
  75.    
  76.     foo(&sz[7]);
  77. }
  78.  
  79.  
  80.  
  81.  
  82. ////////////////////////////////////////////////////
  83. void foo(char *p)                                 //
  84. {
  85.    
  86.      p = p - 7;
  87.    
  88.      for(int i = 0; i < 15; i++)
  89.      {
  90.        printf("p[%d] = %c\n", i, p[i]);
  91.      }
  92. }
  93.  
  94.  
  95. */
  96.  
  97.  
  98.  
  99.  
  100. /*
  101. #include  <stdio.h>
  102. #include <string.h>
  103.  
  104.                                                                                                                                                                   //  opipoipo
  105.  
  106.  
  107. void foo(char *p);  
  108.  
  109. char sz[99];  // = "SONY";
  110.  
  111.  
  112.  
  113. ////////////////////////////////////////////////////
  114. int main()                                        //  
  115. {
  116.    
  117.    
  118.     strcpy(sz, "SONY");
  119.     char c = '0';
  120.    
  121.    
  122.     foo(sz);
  123. }
  124.  
  125.  
  126.  
  127.  
  128. ////////////////////////////////////////////////////
  129. void foo(char *p)                                 //
  130. {
  131.      for(int i = 0; i < 15; i++)
  132.      {
  133.        printf("p[%2d] = %2d\n", i, p[i]);
  134.      }
  135. }
  136.  
  137. */
  138.  
  139.  
  140.  
  141.  
  142. /*
  143.  
  144. #include <stdio.h>
  145.  
  146.  
  147.                                                                                                                                                                   //  opipoipo
  148.  
  149.  
  150. void foo(char *p);  
  151.  
  152.  
  153.  
  154.  
  155.  
  156. ////////////////////////////////////////////////////
  157. int main()                                        //  
  158. {
  159.     char sz[99] = "SONY";
  160.     char c = '0';
  161.    
  162.    
  163.     foo(sz);
  164. }
  165.  
  166.  
  167.  
  168.  
  169. ////////////////////////////////////////////////////
  170. void foo(char *p)                                 //
  171. {
  172.      for(int i = 0; i < 5; i++)
  173.      {
  174.        printf("p[%d] = %d\n", i, p[i]);
  175.      }
  176. }
  177.  
  178.  
  179.  
  180.  
  181. */
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189. /*
  190.  
  191. #include <stdio.h>
  192.  
  193.  
  194.                                                                                                                                                                   //  opipoipoi
  195.  
  196.  
  197.     int n1 =  7;
  198.  
  199. __int32 n2 = 99;
  200. __int8 n3 = 99;
  201.  
  202.  
  203. void foo(char *p);  
  204.  
  205. ////////////////////////////////////////////////////
  206. int main()                                        //  
  207. {
  208.     char sz[99] = "SONY";
  209.    
  210.     printf("size of char = %d\n", sizeof( sz[7]) );
  211.     printf("size of  int = %d\n", sizeof( n3 )   );
  212. }
  213.  
  214.  
  215.  
  216.  
  217. ////////////////////////////////////////////////////
  218. void foo(char *p)                                        //
  219. {
  220.    
  221.    
  222. }
  223.  
  224.  
  225. */
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238. /*
  239. #include <iostream>
  240. using namespace std;
  241.  
  242. int     a,                                                                                           //  kljklj  
  243.       sum,                                                                                        //  kljlkjlkj
  244.     total;                                                                                        //  opipoipoi
  245.  
  246.  
  247. int book();  
  248.  
  249.  
  250.  
  251. ////////////////////////////////////////////////////
  252. int main()                                        //  
  253. {
  254.     setlocale(LC_ALL, "Russian");
  255.     cout << "Введите количество книг: ";
  256.     cin >> a;
  257.     book();
  258.     return 0;
  259. }
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266. /////////////////////////////////////////////////////
  267. int book()                                         //
  268. {
  269.    
  270.     int nPart = a/7,
  271.         nOst  = a%7;
  272.    
  273.     cout << "nPart = " << nPart << endl;
  274.  
  275.     return 0;
  276. }
  277.  
  278.  
  279.  
  280. */
  281.  
  282.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement