|
-
November 16th, 2010, 11:10 AM
#3
Re: Why can't member variable be initialized?
 Originally Posted by Lindley
.... Instead, you have to do
Code:
struct A
{
int i;
A(): i(0) {}
};
Thank you! I suppose this is equivalent to setting the values in the body of the constructor function? Like
?
Last edited by acppdummy; November 16th, 2010 at 11:13 AM.
Tags for this Thread
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
|