few queries on classes and objects

Thread Starter

PG1995

Joined Apr 15, 2011
832
Hi

The queries are about classes and objects in C++.

1: Can I say that a class is a kind of global variable? Can I define a class within the main()?

2: Suppose inputFunc() is a public function of class A and variable Var is a data member of that class. When a call inside the main() is made:

Rich (BB code):
Var.inputFunc();
I think it can be said the call to inputFunc() has been made by the variable Var to be operated upon. Does it make sense?

3: I also believe that ISO C++ doesn't allow initialization of data members inside the class. Is that really so?

Please help me with the queries above. Thanks.
 
Last edited:
Top