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 PostYeah, 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
mvmalderen
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.