如何在c中声明最大的2d字符数组。 [英] How to declare largest 2d character array in c.

查看:87
本文介绍了如何在c中声明最大的2d字符数组。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要这样的两个字符类型2d数组。

I need two character type 2d array like this.

#include<stdio.h>
#include<conio.h> 
#include<string.h>

char queue[200000][10], origin[200000][10];
void main()
{
 ............
}



但是当我编译这个程序时,编译器会显示文件中定义的全局数据过多的错误。我该如何解决这个问题。


But when I compile this program, compiler show an error that "Too much global data define in file.". How can I fix this problem.

推荐答案

避免静态声明太多数据。您可以在堆上分配更多数据: http://en.wikipedia.org/wiki/C_dynamic_memory_allocation [ ^ ]。



-SA
Avoid declaring too much data statically. You can allocate more data on the heap: http://en.wikipedia.org/wiki/C_dynamic_memory_allocation[^].

—SA


这篇关于如何在c中声明最大的2d字符数组。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆