Hello
I think this is easy for experienced C++ users.
I want to define and initialize a [512][512] matrix.
The problem is that when I do int matrix[512][512] I get an error and the program it shuts down.
I think this has to do with max reserve memory.
What can I do?
Thank you
booker 0 Newbie Poster
Recommended Answers
Jump to PostHello
I think this is easy for experienced C++ users.
I want to define and initialize a [512][512] matrix.You probably don't. Tell us why you think you should.
The problem is that when I do int matrix[512][512] I get an error and the program it shuts down.
I think …
Jump to Post>>I initialize the matrix as following and when then I cout, the program crashes..
Look at the <endl it should be <<endl
Are i and j defined?
Try running this code on your compiler;int matrix[512][512]; for(int i=0;i<512;i++){ for(int j=0;j<512;j++){ matrix[i][j]=-1; } } cout<<matrix[100][100]<<endl;
All 5 Replies
Nick Evan 4,005 Industrious Poster Team Colleague Featured Poster
tux4life 2,072 Postaholic
booker 0 Newbie Poster
siddhant3s 1,429 Practically a Posting Shark
booker 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.