不是要传整个互联网啊,是编译器怎么“提前”知道用户输入的啊[/quote]
我的意思是研究怎样将数组作为函数参数或函数返回值是浪费生命的一种方法。
默认栈大小参考:
/STACK (Stack Allocations)
Home | Overview | How Do I | Linker Options
The Stack Allocations (/STACK:reserve[,commit]) option sets the size of the stack in bytes.
To find this option in the development environment, click Settings on the Project menu. Then click the Link tab, and click Output in the Category box. The Reserve text box (or in the reserve argument on the command line) specifies the total stack allocation in virtual memory. The default stack size is 1 MB. The linker rounds up the specified value to the nearest 4 bytes.
The optional value specified in the Commit text box (or in the commit argument on the command line) is subject to interpretation by the operating system. In Windows NT, it specifies the amount of physical memory to allocate at a time. Committed virtual memory causes space to be reserved in the paging file. A higher commit value saves time when the application needs more stack space, but increases the memory requirements and possibly the startup time.
Specify the reserve and commit values in decimal or C-language notation.
Another way to set the size of the stack is with the STACKSIZE statement in a module-definition (.DEF) file. STACKSIZE overrides the Stack Allocations (/STACK) option if both are specified. You can change the stack after the .EXE file is built by using the EDITBIN tool.