Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. int globalNum;
  2.  
  3. void doSomthing();
  4.  
  5. class testClass{
  6.   protected:
  7.     int num
  8.  
  9.   public:
  10.     void setNum(int temp){num = temp;}
  11.     int getNum(){return num;}
  12. };
  13.  
  14. void main{
  15.   globalNum = 5;
  16.   testClass C;
  17. }
  18.  
  19. void doSomething()
  20. {
  21.   C.setNum(globalNum);  // C undeclared (first use this function)
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement