Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/164.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 用于增加堆栈大小的预处理器指令无效 #包括 #包括 #包括 使用名称空间std; void showArray(int data[],int n); int分区(int数据[],int低,int高); 无效快速排序(int数据[],int低,int高); 无效排序(整数数据[],整数n); 整数比较计数; 整数排序计数; #pragma注释(链接器,“/STACK:8000000”) int main() { srand((未签名)时间(0)); 整数; int最低=1,最高=1000; 整数范围=(最高-最低)+1; int arrayList[1000]; 对于(int i=0;i_C++_Stack_Preprocessor Directive - Fatal编程技术网

C++ 用于增加堆栈大小的预处理器指令无效 #包括 #包括 #包括 使用名称空间std; void showArray(int data[],int n); int分区(int数据[],int低,int高); 无效快速排序(int数据[],int低,int高); 无效排序(整数数据[],整数n); 整数比较计数; 整数排序计数; #pragma注释(链接器,“/STACK:8000000”) int main() { srand((未签名)时间(0)); 整数; int最低=1,最高=1000; 整数范围=(最高-最低)+1; int arrayList[1000]; 对于(int i=0;i

C++ 用于增加堆栈大小的预处理器指令无效 #包括 #包括 #包括 使用名称空间std; void showArray(int data[],int n); int分区(int数据[],int低,int高); 无效快速排序(int数据[],int低,int高); 无效排序(整数数据[],整数n); 整数比较计数; 整数排序计数; #pragma注释(链接器,“/STACK:8000000”) int main() { srand((未签名)时间(0)); 整数; int最低=1,最高=1000; 整数范围=(最高-最低)+1; int arrayList[1000]; 对于(int i=0;i,c++,stack,preprocessor-directive,C++,Stack,Preprocessor Directive,每当我尝试运行此命令时,就会发现错误…找到无效指令“8000000”;不以“/”开头 此代码的不可见部分将涉及大量递归,因此需要增加堆栈大小。我不知道那个导演为什么不工作 链接器选项中不应包含任何空格 #pragma注释(链接器,“/STACK:8000000”) //^此处没有空间 删除空格。很明显,不是吗?我明白了。该代码是从教授的文档中复制和粘贴的,所以我认为它是正确的。@Jason当事情不按您的预期运行时,没有什么可以替代的 #include <iostream> #inc

每当我尝试运行此命令时,就会发现错误…
找到无效指令“8000000”;不以“/”开头


此代码的不可见部分将涉及大量递归,因此需要增加堆栈大小。我不知道那个导演为什么不工作

链接器选项中不应包含任何空格

#pragma注释(链接器,“/STACK:8000000”)
//^此处没有空间

删除空格。很明显,不是吗?我明白了。该代码是从教授的文档中复制和粘贴的,所以我认为它是正确的。@Jason当事情不按您的预期运行时,没有什么可以替代的
#include <iostream> 
#include <ctime> 
#include <cstdlib>
using namespace std;

void showArray(int data[], int n);
int partition(int data[], int low, int high);
void quicksort(int data[], int low, int high);
void sort(int data[], int n);

int comparisonCount;
int sortCount;

#pragma comment(linker, "/STACK: 8000000")


int main()
{
srand((unsigned)time(0));
int random_integer;
int lowest = 1, highest = 1000;
int range = (highest - lowest) + 1;
int arrayList[1000];


for (int i = 0; i < highest; i++) {
    random_integer = lowest + int(range*rand() / (RAND_MAX + 1.0));
    arrayList[i] = random_integer;
}


sort(arrayList, highest);
showArray(arrayList, highest);


}