Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int globalNum;
- void doSomthing();
- class testClass{
- public:
- testClass();
- int num
- protected:
- void setNum(int temp){num = temp;}
- int getNum(){return num;}
- };
- void main{
- globalNum = 5;
- testClass C;
- }
- void doSomething()
- {
- C.setNum(globalNum); // C undeclared (first use this function)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement