I am trying and cause a segmentation fault by using as few characters as possible.
Please help Thanks
#include iostream
int main(int argc, char** argv) {
std::cout << "argc="<<argc<<" argv="<<"argc="<<argv<<std::endl;
return 0;
}
I am trying and cause a segmentation fault by using as few characters as possible.
Please help Thanks
#include iostream
int main(int argc, char** argv) {
std::cout << "argc="<<argc<<" argv="<<"argc="<<argv<<std::endl;
return 0;
}
Welcome @loving_programming,
aside from the fact that #include iostream
is syntactically incorrect, your code looks pretty pointless. What is the intention behind it?
To produce a segfault, you can e.g. dereference a noninitialized pointer:
int main(){int *x;return *x;}
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.