|
-
May 12th, 1999, 04:00 PM
#1
C++ programming
Hi all,
My question is, Is it legal to use 'this' pointer inside a constructor? for example
class Test
{
private
int var;
public
void Test(int); // constructor
};
Test *ptrToTest; // defined outside the class definition
void Test::Test(int) // constructor
{
var = int;
ptrToTest = this ; // is this legal to do?
}
Thank you all in advance for your help.
Anna
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
|