Code implementation I was trying to implement the code such way that it takes only a command line argument, and if not provided or provided more than 1, it prints out an error message. But it is showing "segmentation fault(core dumped)" whenever I am not giving any argument in the command line. What have I done wrong?
Asked
Active
Viewed 19 times
0
-
Turn on compiler warnings -- `int main` is supposed to return something. That said, there is no way for the code you show to die with segmentation fault -- something is wrong with your environment. – Employed Russian Jul 02 '23 at 00:10