So as the title says in my C Program i get as command line inputs as usual argc and argv. However upon further inspecting, i realized that my incoming argc is a completely random number.
Here is the start of my program where i want to know the value of argc.
void debug(char *format, ...) {
if(DEBUG_MODE!=0) return;
va_list arg;
va_start (arg, format);
(void) fprintf (stdout, format, arg);
va_end (arg);
}
int main(int argc, char *argv[]) {
debug("ARGC %i\n", argc);
Where debug() is just a better print method. So when i start my program with:
./server
I just get as a result:
ARGC -1786798448
So i really dont understand this.