Advertisement
AlexLeo

inline in C++

Nov 6th, 2014
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3. using namespace std;
  4.  
  5. typedef struct CStruct
  6. {
  7.     int cStructInt=1;
  8. };
  9.  
  10. typedef struct CStruct2 : CStruct
  11. {
  12.     inline int returnCStructInt()
  13.     {
  14.         return cStructInt;
  15.     }
  16. };
  17.  
  18. int main()
  19. {
  20.     CStruct2 cst2;
  21.  
  22.     cout << "cStructInt=" << cst2.returnCStructInt() << '\n';
  23.  
  24.     //system("pause");
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement