![]() |
calling ctor inside a member function of a class
Hello. May I ask a question to the ctor in this program.
main.cpp: Code:
#include <iostream>Code:
#pragma onceThanks. F.R. |
Re: calling ctor inside a member function of a class
Its because when you are calling a constructor its creating a new object and assigning the value 0 and as the object goes out of scope its destroyed and so the object in the main does not reflect zero.
|
| All times are GMT +5.5. The time now is 04:13. |