首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

递归调用,STACK OVERFLOW,修改VC #pragma comment(linker,"/STACK:10240,2048")无效

2012-01-22 
递归调用,STACK OVERFLOW,修改VC #pragma comment(linker,/STACK:10240,2048)无效各位大侠:小弟程序如下

递归调用,STACK OVERFLOW,修改VC #pragma comment(linker,"/STACK:10240,2048")无效
各位大侠:
小弟程序如下:
#include   <stdio.h>
#include   <string.h>
#include   <malloc.h>
#include   <math.h>

  #pragma   comment(linker, "/STACK:10240,2048 ")

void   diufan(int   i)
{
int   sp_;

_asm   {
//mov   esp,   0x400;
        mov   sp_,   esp;   ////   mov   sp_,   esp;
    };
    i   =   i   -   1;
    if(i   ==   0)   return   ;
    printf( "%d   %d\n\r ",sp_,i);
    diufan(i);

}


void   main()
{
diufan(1000000);
}

但是似乎和系统默认的OVERFLOW情况相同,即益出点相同,请各位帮忙!
谢谢

[解决办法]
当然,进程的堆栈的极限肯定大于线程的极限,但是不会超出太离谱。
[解决办法]
1048576000字节 / 1024 = 1024000 K字节
1024000K / 1024 = 1000MB

看你楼上星星的话.

热点排行