|
-
November 30th, 2002, 12:34 PM
#1
A question about constructor function
class T
{
public:
int m_i ;
T () { m_i = 1 ; }
T(int k ) { T() ; }
};
int main()
{
T t(0 );
cout<< t.m_i <<endl;
return 0;
}
When i invoke a constructor funciton within another constructor funciton , this constructor will not impact on this object .
In the above sample code , The t.m_i will remain uninitialize . why
? i test it in VC6.
I have gone throught the ISO C++ specificaiton , but no any thread was been found .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|