//read the elements of the array
cout<<"Enter all the elements of the array"<<endl;
for(j=0;j<size;j++)
cin>>arr[j];
//populate the elements of the array
cout<<endl<<"Entered elements are as follows"<<endl;
for(j=0;j<size;j++)
cout<<arr[j]<<" ";
代码是用gcc编译的。 当我在ubuntu 14.04中运行代码并输入大于8的数组时,我没有得到任何输出。
> kv@kv:~/c_quizzes$ g++ quick_sort.c
> kv@kv:~/c_quizzes$ ./a.out
> Enter the size of the array
12
> Enter all the elements of the array
1 22 32 11 212 32323 9839 09 0 -90 99 9
> Entered elements are as follows
^C
> kv@kv:~/c_quizzes$