LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Class constructor not being called (https://www.linuxquestions.org/questions/programming-9/class-constructor-not-being-called-22498/)

ChimpFace9000 06-03-2002 06:07 PM

Class constructor not being called
 
I have a class and the constructor doesnt take any parameters. In my main file, i have a global variable of the class defined like this.. (cube is the class)...

cube cube1;

The problem is that the classes constructor isnt being called at the right place. I put some code to print out a string in the constructor, and the string doesnt print until after i close the main window to exit the application. Meaning the constructor isnt being called until the end of the program. But it needs to be called at the beginning. Any ideas?

Sfin 06-03-2002 08:54 PM

hmm can you post some code snippets.

Particularly these:

1) The Class
2) The Constructor code


All times are GMT -5. The time now is 05:04 PM.