I don't even know what is happening, I just started a new project and setup a basic cat just to make sure everything was working, and this happened.
#include "stdlib.h"
#include "stdio.h"
int main(int argc, char *argv) {
printf("%s",argv[0]);
return 0;
}
That's it, I reinstalled gcc, g++, and both multilibs. I really have no clue what to even think.
The declared type of
argv
is wrong. The signature ofmain
should be one of:Note that
main
can also takevoid
to ignore parameters, but this is not what you're looking for here.I personally prefer the second form listed above as I find it more intuitive (array of
char*
) vs the first (pointer tochar*
), but since arrays are merely pointer arithmetic in C, either will do.