sir i am not unable to use inbuilt sort() it’s showing not declared in this scope …
After adding #include
it’s showing
*** stack smashing detected ***: terminated
i guess stack overflow …
sir i am not unable to use inbuilt sort() it’s showing not declared in this scope …
After adding #include
it’s showing
*** stack smashing detected ***: terminated
i guess stack overflow …
#include
#include <bits/stdc++.h>
using namespace std;
int main(){
int a[]={3,6,32,1,2};
int n = sizeof(a);
sort(a,a+n);
for(int i=1;i<n;i++){
cout<<a[i]<<endl;
}
cout<<endl;
return 0;
}
output :
-920664064
-12690632
0
0
1
1
2
3
6
32
21973
32662
32662
32767
32767
72704
1421951107
1423821696
1772804999
*** stack smashing detected ***: terminated
problem solved …
size = sizeof(arr)/sizeof(int)
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.