my code is :
#include <stdio.h>
void main( int argc, char** argv) {
printf("%s", argv[0]);
system("pwd");
}
The output is:
[river@localhost studio]$ ./a.out
/home/river/Desktop/studio
./a.out[river@localhost studio]$
It seems that system("pwd") print first , then print argv[0] . why? If I add a statement like following :
#include <stdio.h>
void main( int argc, char** argv) {
printf("%s", argv[0]);
fflush(stdout);
system("pwd");
}
The output is :
[river@localhost studio]$ ./a.out
./a.out/home/river/Desktop/studio
It work normally, why ?