2

I'm compiling very simple program on Ubuntu-14 32bit:

#include <stdio.h>
#include <stdarg.h>

void test(char *fmt, ...) {
    va_list args;
    va_start(args, fmt);

    printf(fmt, args);

    va_end(args);
}

int main(int argc, char** argv) {
    test("%u\n", 123);
    printf("%u\n", 123);
    return 0;   
}

with

gcc -c *.c
gcc -o test.bin ./*.o 

While getting this output

3214954436 
123

the first number is changing every time I run test.bin

What am I missing here?

x_arrange
  • 317
  • 2
  • 12

0 Answers0