|
-
Feb 23rd, 2003, 12:45 PM
#1
member array initializing
Assuming I have a class:
Code:
class A
{
int[8] values;
};
How would I initialize all elements of values to 0 in the constructor initializer list?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Feb 23rd, 2003, 04:14 PM
#2
As far as I know, you can't. In this case it doesn't matter that much though, you could do it in the constructor's body. But when you have something other then ints it could be a problem.
-
Feb 23rd, 2003, 05:51 PM
#3
I have pointers, so it isn't a problem. I was just looking for a way because it makes inlining easier for the compiler.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|