Advertisement
Guest User

Untitled

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