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;
}
Sounds like a candidate for code golf.
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;}