Advertisement
dllbridge

Untitled

Feb 25th, 2023
781
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.80 KB | None | 0 0
  1.  
  2.  
  3.  
  4. #include  <stdio.h>
  5. #include <string.h>
  6. #include <stdlib.h>
  7.  
  8.  
  9. int n = 99;
  10.  
  11.  
  12.  
  13.  
  14. /////////////////////////////////////////////////////////////
  15. struct keyvalue
  16. {
  17.    
  18.    char sz[17];
  19.    
  20.    int n;
  21.    
  22.    
  23. };
  24.  
  25.  
  26.  
  27.  
  28. ////////////////////////////////////////////////////////////
  29. int main()
  30. {  
  31.    
  32.     keyvalue tt;
  33.    
  34.     tt.n = 20;
  35.    
  36.     strcpy(tt.sz, "S O N Y");  
  37.    
  38.     printf("size of tt = %d\n", sizeof(tt));
  39.    
  40.     printf("&tt    = %d\n", &tt);
  41.     printf("&tt.sz = %d\n",  tt.sz   );    
  42.     printf("&tt.sz = %d\n", &tt.sz[0]);    
  43.    
  44. }
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. /*
  73.  
  74. #include  <stdio.h>
  75. #include <string.h>
  76. #include <stdlib.h>
  77.  
  78.  
  79. int n = 99;
  80.  
  81.  
  82.  
  83.  
  84. /////////////////////////////////////////////////////////////
  85. struct keyvalue
  86. {
  87.    
  88.    char sz[17];
  89.    
  90.    int n;
  91.    
  92.    
  93. };
  94.  
  95.  
  96.  
  97.  
  98. ////////////////////////////////////////////////////////////
  99. int main()
  100. {  
  101.    
  102.     keyvalue tt;
  103.    
  104.     tt.n = 20;
  105.    
  106.     strcpy(tt.sz, "S O N Y");  
  107.    
  108.     strcat(tt.sz, " Pictures");
  109.    
  110.     printf("tt.sz = %s\n", tt.sz); 
  111.        
  112.     printf("tt.n = %d\n", tt.n);
  113.    
  114.     printf("len = %d\n", strlen(tt.sz));
  115.    
  116. }
  117.  
  118.  
  119. */
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. /*
  140.  
  141. #include <stdio.h>
  142. #include <stdlib.h>
  143.  
  144.  
  145. int n = 99;
  146.  
  147.  
  148.  
  149.  
  150. /////////////////////////////////////////////////////////////
  151. struct keyvalue
  152. {
  153.    
  154.    char sz[17];
  155.    
  156.    int n;
  157.    
  158.    
  159. };
  160.  
  161.  
  162.  
  163.  
  164. ////////////////////////////////////////////////////////////
  165. int main()
  166. {  
  167.    
  168.     keyvalue tt;
  169.    
  170.     tt.n = 20;
  171.    
  172.     tt.sz[0] = 'S';
  173.     tt.sz[1] = 'O';    
  174.     tt.sz[2] =  78;
  175.     tt.sz[3] = 'Y';    
  176.     tt.sz[4] =  0 ;    
  177.    
  178.     printf("tt.sz = %s\n", tt.sz); 
  179.        
  180.     printf("tt.n = %d\n", tt.n);
  181.    
  182.     printf("tt.sz[2] = %d\n", tt.sz[2]);
  183.    
  184. }
  185.  
  186.  
  187. */
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217. /*
  218.  
  219. #include <stdio.h>
  220. #include <stdlib.h>
  221.  
  222.  
  223. int n = 99;
  224.  
  225.  
  226. struct Ctt
  227. {
  228.    
  229.    int n;  
  230.    
  231. }tt;
  232.  
  233.  
  234.  
  235.  
  236. ////////////////////////////////////////////////////////////
  237. int main()
  238. {  
  239.    
  240.     tt.n = 20;
  241.    
  242.     printf("tt.n = %d\n", tt.n);
  243.    
  244.    
  245. }
  246.  
  247.  
  248.  
  249. */
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291. /*
  292.  
  293. #include <stdio.h>
  294. #include <stdlib.h>
  295.  
  296.  
  297. int n = 99;
  298.  
  299. ////////////////////////////////////////////////////////////
  300. int main()
  301. {  
  302.    
  303.     int *p = (int*)malloc(sizeof(int));
  304.    
  305.    
  306.     int &nSONY = *p;
  307.    
  308.     nSONY = 128;
  309.    
  310.     printf("nSONY = %d\n", nSONY);
  311. }
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319. */
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342. /*
  343. #include <stdio.h>
  344. #include <stdlib.h>
  345.  
  346.  
  347. int n = 99;
  348.  
  349. ////////////////////////////////////////////////////////////
  350. int main()
  351. {  
  352.    
  353.     int *p = (int*)malloc(4);
  354.    
  355.    
  356.     int &nSONY = *p;
  357.    
  358.     nSONY = 128;
  359.    
  360.     printf("nSONY = %d\n", nSONY);
  361. }
  362.  
  363.  
  364.  
  365. */
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement