Advertisement
dllbridge

Untitled

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