我如何看到刚刚创建的完整的20x70 2D数组?C
How can I see the full 20x70 2d array that I just created? C++
新的。好的,所以在我的项目中,我有一个20x70 2D阵列,但是使用通常的2D阵列打印我看不到所有这些。通过"看到一切",我的意思是我的控制台太小了。有什么方法可以打印完整的矩阵并在控制台中看到它?还是有任何可以帮助我像画布中打印它的图书馆?编辑:我正在使用CodeBlocks作为我的IDE,并在Windows控制台中工作。我在Google上搜索了一段时间,但我没有找到这个问题的答案。我只找到了如何打印10x10 2D阵列的答案。
您可以尝试调整控制台窗口的大小:
#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);
}
相关文章:
- 2D数组来自文本输入,中间有空格
- 将值指定给向量(2D)的向量中的某个位置
- 如何使用用户输入在C++中正确填充2D数组
- 如何在C++中检查2D数组中负值的输入验证
- 当我在main中声明了我的2d数组时,为什么我的程序会退出
- 在 2D 向量中使用第三个 [ ] 有什么意义?
- 四边形的 2D 旋转
- 打印第二列时的2d字符矢量打印空间
- 如何将以逗号和空格分隔的整数读取到 2D 数组中?
- 如何在C++函数中声明静态 2D 数组?
- 我是 C++ 的初学者,我想知道如何在 2D 矢量中获取重复值
- 如何声明一个可以在整个程序中使用的全局 2d 3d 4d .. 数组(堆版本)变量?
- opengl glBegin(GL_LINES) 和 glBegin(GL_POINT) 在 2D 中不可视化点矢量
- 在C++中迭代 2D 容器的最干净方法
- 如何引用 2D 指针?
- 如何在 C++ 中使用它的构造函数初始化 unique_ptrs 的 2D 向量?
- C++动态安全 2D 交错阵列
- 如何在C++或OpenCV子矩阵中的2D子向量上使用OpenACC?
- 我已经阅读了很多关于 2d 数组的信息,但我在作业中使用它时遇到了麻烦
- 我如何看到刚刚创建的完整的20x70 2D数组?C