If you are interested in what could have happened under the hood, consider that sabonete on your platform is 4 bytes wide (as a pointer), and since your main object did not declare parameters (that the OS should match anyway), it may take one and the same memory space, which is usually in the reverse order of parameters.
That's right, it overwrites char ** argv, which points to an array of pointers (it must contain at least 16 of them), which points to lines containing parts of the command line.
In fact, you assign your values by writing them to this array, and since it belongs to your program, the OS does not complain. And since you never refer to original values, and no one changes them, everything looks fine.
But this is not so, because it is normal. This is because you are lucky that you are using the right place for something else that you are not interested in.
source share