New here. Okay so in my project I have a 20x70 2d array, but I can't see it all using the usual 2d array printing. By "see it all" I mean my console is too small. Is there any way of printing the full matrix and see it in the console? Or is there any library that could help me printing it like in a canvas? Edit: I'm using Codeblocks as my IDE and working in a Windows Console. I've searched on google for some time and I didn't find an answer to this question. I found only answers to how to print a 10x10 2d array.
Asked
Active
Viewed 71 times
-3
-
Welcome to Stack Overflow. Please take the time to read [The Tour](http://stackoverflow.com/tour) again and refer to the material from the [Help Center](http://stackoverflow.com/help/asking) what and how you can ask here. – πάντα ῥεῖ Mar 12 '17 at 07:54
1 Answers
-2
You can try to resize the console window as described here:
#include <iostream>
//the following line is necessary for the
// GetConsoleWindow() function to work!
//it basically says that you are running this
// program on Windows 2000 or higher
#define _WIN32_WINNT 0x0500
//it is important that the above line be typed
// BEFORE <windows.h> is included
#include <windows.h>
using namespace std;
int main (void)
{
HWND console = GetConsoleWindow();
RECT r;
GetWindowRect(console, &r); //stores the console's current dimensions
//MoveWindow(window_handle, x, y, width, height, redraw_window);
MoveWindow(console, r.left, r.top, 800, 600, TRUE);
for (int j = 0; j < 100; ++j)
{
for (int i = 0x41; i < 0x5B; ++i)
cout << (char)i;
}
cout << endl;
Sleep(1000);
MoveWindow(console, r.left, r.top, r.right - r.left, r.bottom - r.top, TRUE);
}

Igor Kleinerman
- 143
- 1
- 8
-
1
-
@IgorKleinerman Yeah this answer did it for me. I liked how you refreshed the console to it's normal size at the end so I could see the difference. And you taught me another thing with "0x41" and "0x5B". I didn't know those were the adresses from A to Z. I just hope this post won't get deleted because I'm sure that a lot of people are searching for this answer and some of them won't think about typing "How to resize the console". Another solution can be printing in a file, but I didn't asked for that. Because I need it after every iteration and the console is more convenient. – Eduard Mar 12 '17 at 11:48