You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The C code is compiled with gcc version 4.8.2 and executable is a.out.
The C executable a.out is a simple hello world program, i am getting the correct output, but i can't understand why exec.Wait() is exiting with status code 11 and not with 0.
The executable('a.out') is running normally when i run on a linux terminal without any faults or errors
The text was updated successfully, but these errors were encountered:
Your C program does not contain a return statement. If you build it with 'gcc -Werror' it should tell you this, I would think. In any case, because there is no return statement, main returns whatever is in register AX when it ends. That turns out to be the return value from printf, the length of "hello world", 11.
When you run the program on a Linux terminal you are getting exactly the same behavior, but you are ignoring it. Try:
hi,
I executing a C executable using exec.Command and exec.Start(). My C executable is in the current directory and this is my code
When i run this code, this is the output i get
My C hello world program is simple
The C code is compiled with gcc version 4.8.2 and executable is a.out.
The C executable a.out is a simple hello world program, i am getting the correct output, but i can't understand why exec.Wait() is exiting with status code 11 and not with 0.
The executable('a.out') is running normally when i run on a linux terminal without any faults or errors
The text was updated successfully, but these errors were encountered: