Advertisement
dllbridge

Untitled

Mar 12th, 2022
945
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1.  
  2.  
  3. #include    <stdio.h>
  4. #include   <string.h>
  5.  
  6. //using namespace std;
  7.  
  8.  
  9. class YY
  10. {
  11.     public:
  12.    
  13.     int old;  
  14.  
  15.     char szName[123];
  16.    
  17.     void foo(int);
  18.  
  19.    
  20. } yy[12], yy1;
  21.  
  22.  
  23.  
  24.  
  25.  
  26. ////////////////////////////////////////////////////
  27. int main()                                        //
  28. {
  29.  
  30.  
  31.     int n = 9;
  32.  
  33.  
  34.  
  35.    
  36.     yy[5].old = 27;
  37.  
  38.     strcpy(yy[5].szName, "Oleg");
  39.  
  40.     yy[5].foo(3);
  41.  
  42.     printf("Name is %s \n", yy[5].szName);
  43.     printf("Old   = %d \n", yy[5].old);
  44. return 0;
  45. }
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.     void YY::foo(int n)
  53.     {
  54.        
  55.        old = old - n;  
  56.        
  57.     }  
  58.  
  59.  
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement