Click here to Skip to main content
15,923,273 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Test if a FILE is open Pin
Blake Miller25-Jan-07 11:15
Blake Miller25-Jan-07 11:15 
GeneralRe: Test if a FILE is open Pin
#realJSOP25-Jan-07 11:55
professional#realJSOP25-Jan-07 11:55 
AnswerRe: Test if a FILE is open Pin
#realJSOP25-Jan-07 11:56
professional#realJSOP25-Jan-07 11:56 
GeneralRe: Test if a FILE is open Pin
Mark Salsbery25-Jan-07 12:06
Mark Salsbery25-Jan-07 12:06 
QuestionBurning CDs Pin
RedDragon2k25-Jan-07 6:02
RedDragon2k25-Jan-07 6:02 
AnswerRe: Burning CDs Pin
David Crow25-Jan-07 6:21
David Crow25-Jan-07 6:21 
AnswerRe: Burning CDs Pin
Hamid_RT25-Jan-07 21:00
Hamid_RT25-Jan-07 21:00 
QuestionHow to initialize a 2D array correctly? :confused: Pin
KaKa'25-Jan-07 5:55
KaKa'25-Jan-07 5:55 
Hello,

How do I initialize a global 2D array in C++?

First, I declared the 2D array outside of the main function.
int data[32][5];

Then in the main function, I initialized the array:

data[32][5] = {{0,0,0,0,0},
{0,0,0,0,1},{0,0,0,1,0},{0,0,0,1,1},{0,0,1,0,0},{0,0,1,0,1},
{0,0,1,1,0}, ......................(rest of the integers here)..........
..................................................................................
{1,1,1,1,1}};

The above is what I typed into visual c++ 2005. After the comma of the first bracket and every 5th bracket, I pressed 'Enter' to go to a new line.

However, when I compiled, there were syntax errors saying that there are missing ; before '{' or '}' .

What is the syntax error? Smile | :)
AnswerRe: How to initialize a 2D array correctly? :confused: Pin
Roger Stoltz25-Jan-07 6:18
Roger Stoltz25-Jan-07 6:18 
AnswerRe: How to initialize a 2D array correctly? :confused: Pin
David Crow25-Jan-07 6:26
David Crow25-Jan-07 6:26 
AnswerRe: How to initialize a 2D array correctly? :confused: Pin
Michael Dunn25-Jan-07 8:18
sitebuilderMichael Dunn25-Jan-07 8:18 
GeneralRe: How to initialize a 2D array correctly? :confused: Pin
Roger Stoltz25-Jan-07 11:15
Roger Stoltz25-Jan-07 11:15 
QuestionVisual C++ 1.52 error Pin
jnhemley25-Jan-07 5:55
jnhemley25-Jan-07 5:55 
AnswerRe: Visual C++ 1.52 error Pin
Ravi Bhavnani25-Jan-07 5:59
professionalRavi Bhavnani25-Jan-07 5:59 
GeneralRe: Visual C++ 1.52 error Pin
jnhemley25-Jan-07 6:03
jnhemley25-Jan-07 6:03 
AnswerRe: Visual C++ 1.52 error Pin
jnhemley25-Jan-07 6:00
jnhemley25-Jan-07 6:00 
AnswerRe: Visual C++ 1.52 error Pin
Ted Ferenc25-Jan-07 6:26
Ted Ferenc25-Jan-07 6:26 
GeneralRe: Visual C++ 1.52 error Pin
jnhemley25-Jan-07 8:33
jnhemley25-Jan-07 8:33 
AnswerRe: Visual C++ 1.52 error Pin
Mike O'Neill26-Jan-07 10:42
Mike O'Neill26-Jan-07 10:42 
QuestionIterating over Dialog? Pin
bosfan25-Jan-07 5:38
bosfan25-Jan-07 5:38 
AnswerRe: Iterating over Dialog? Pin
Ravi Bhavnani25-Jan-07 5:41
professionalRavi Bhavnani25-Jan-07 5:41 
GeneralRe: Iterating over Dialog? Pin
bosfan25-Jan-07 5:48
bosfan25-Jan-07 5:48 
AnswerRe: Iterating over Dialog? Pin
Roger Stoltz25-Jan-07 6:05
Roger Stoltz25-Jan-07 6:05 
AnswerRe: Iterating over Dialog? Pin
#realJSOP25-Jan-07 8:26
professional#realJSOP25-Jan-07 8:26 
QuestionUgh! Resource problems and 'Clean-up' tools Pin
Like2Byte25-Jan-07 3:25
Like2Byte25-Jan-07 3:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.