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 Post— Nick Evan 4,005Hello
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— tux4life 2,072Yeah, I tried this, it was compiling ...
I stored a value in it but when displaying with cout it didn't display anything ...You're probably better off with a vector:
// Create vector< vector<int> > vec(512, vector<int>(512)); // Write vec[2][3] = 10;
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.