Advertisement
dllbridge

Untitled

Aug 22nd, 2024
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.01 KB | None | 0 0
  1.  
  2. // Cpp Lang: //
  3.  
  4.  
  5. #include       <stdio.h>
  6. #include       <string.h>
  7.  
  8. struct TT
  9. {
  10.        
  11.      int       n;
  12.      char sz[99];  
  13.        
  14. };
  15.  
  16. void foo(TT &dfgdfgdfg);
  17.  
  18.  
  19. ////////////////////////////////////////////////////
  20. int main()                                        //
  21. {
  22.     TT  t1, t2, tarr[55];  
  23.    
  24.     t1.n = 2016;
  25.    
  26.     strcpy(t1.sz, "Gleb");
  27.    
  28.     foo(t1);
  29.     printf("D     = %c\n", t1.sz[0]);
  30.     printf("D     = %d\n", t1.sz[0]);      
  31. }
  32.  
  33.  
  34.  
  35. /////////////////////////////////////////////////////
  36. void foo(TT &a)                                    //
  37. {
  38.  
  39.      printf("t1.n  = %d\n", a.n );
  40.      
  41.      
  42.      printf("t1.sz = %s\n", a.sz);
  43. }
  44.  
  45.  
  46.  
  47. //  C Lang:  //
  48.  
  49.  
  50. #include       <stdio.h>
  51. #include       <string.h>
  52.  
  53. struct TT
  54. {
  55.        
  56.      int       n;
  57.      char sz[99];  
  58.        
  59. };
  60.  
  61. void foo(struct TT *p);
  62.  
  63.  
  64. ////////////////////////////////////////////////////
  65. int main()                                        //
  66. {
  67.     struct   TT  t1, t2, tarr[55]; 
  68.    
  69.     t1.n = 2006;
  70.    
  71.     strcpy(t1.sz, "Tanya");
  72.    
  73.     foo(&t1);
  74.     printf("D     = %c\n", t1.sz[0]);
  75.     printf("D     = %d\n", t1.sz[0]);      
  76. }
  77.  
  78.  
  79.  
  80. /////////////////////////////////////////////////////
  81. void foo(struct TT *p)                             //
  82. {
  83.  
  84.      printf("t1.n  = %d\n", (*p)    .n );
  85.      
  86.      
  87.      printf("t1.sz = %s\n", p->sz);
  88. }
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102. /*
  103.  
  104. #include       <stdio.h>
  105.  
  106.  
  107. struct TT
  108. {
  109.        
  110.      int       n;
  111.      char sz[99];  
  112.        
  113. };
  114.  
  115.  
  116.  
  117.  
  118. ////////////////////////////////////////////////////
  119. int main()                                        //
  120. {
  121.     struct   TT  t1, t2, tarr[55]; 
  122.    
  123.     t1.n = 2002;
  124.    
  125.     t1.sz[0] = 'D';
  126.     t1.sz[1] = 'i';  
  127.     t1.sz[2] = 'm';
  128.     t1.sz[3] = 'a';
  129.     t1.sz[4] =  0 ;  //'\0';  
  130.    
  131.     printf("t1.n  = %d\n", t1.n );
  132.     printf("t1.sz = %s\n", t1.sz);
  133.     printf("D     = %c\n", t1.sz[0]);
  134.     printf("D     = %d\n", t1.sz[0]);      
  135. }
  136.  
  137.  
  138. */
  139.  
  140.  
  141.  
  142.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement