Problem in checking file abort

Hi,

I would like to know given executing a file with inputs, I would like to know when does it terminate /abort abnormally.

I tried to append an echo $? after executing my program which is in C. However, there is nothing..It shows 0 even though the program actually exit.

my command is something like

a.exe 4 4 4 < 3 3 3 | echo $?

Please advise. Thanks.

Your example runs the echo command and a.exe at the same time and redirects the output from one to another, you want to run a.exe then (once it finishes running) ask the shell for the exit code.
Try:

a.exe 4 4 4 < 3 3 3 ; echo $?