小编use*_*497的帖子

C中的大型2D阵列 - Stack OverFlow错误

我很久没有使用过C了,而且我在用CSV填充2D数组时遇到了问题.文件格式如下:

节点,输入,输出

1,200,10393

...

这实际上是链表的数组表示.有150000个元素,每当我尝试填充数组时,我得到一个错误,说"在main.exe中0x000000013facb957处未处理的异常:0xC00000FD:堆栈溢出." 我在64位机器上使用16GB RAM,而我正在使用带有x64构建配置的VS C++ 2010 Express.

int main(int argc, char *argv[])
{

int counter = 0;
char line [ 1024 ];
int map[150000][2] = {0};
char *comma = ",";
char *token;
int index;
int in, out;
char* end;
int nodeID;
FILE *fp;

fp = fopen("mapsorted.txt","r"); // read mode

if( fp == NULL )
{
  perror("Error while opening the file.\n");
  exit(EXIT_FAILURE);
}

//Skip header line
fgets ( line, sizeof line, fp );

while ( fgets ( line, …
Run Code Online (Sandbox Code Playgroud)

c stack-overflow arrays

3
推荐指数
1
解决办法
1743
查看次数

标签 统计

arrays ×1

c ×1

stack-overflow ×1