|
-
May 1st, 2008, 02:26 PM
#1
Comma usage in initializers
Consider the following example:
Code:
int foo[] = { 3, 4, 5, };
Note that above I have a comma operator after the last element in the initializer. An example presenting the exact same behavior can be found in the standard at 8.5.1.11:
 Originally Posted by C++03 Standard : Paragraph 8.5.1.11
Code:
float y[4][3] = {
{ 1, 3, 5 },
{ 2, 4, 6 },
{ 3, 5, 7 },
};
However, I can't find anywhere in the standard that describes that this behavior is allowed. The standard has always been difficult for me to read, since it doesn't always find the most intuitive way of explaining things. Could someone reference me to the paragraph or set of paragraphs that explains the behavior of placing a comma after the last item in an initializer?
--MrDoomMaster
--C++ Game Programmer
Don't forget to rate me if I was helpful!
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
|