few queries on classes and objects

Thread Starter


Joined Apr 15, 2011

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):
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: