Using exit codes ? (errorlevel 's) and Playing a wav file
Hey, i'm kinda new to C programming, i've search the net through yahoo/google and searched this site and board and still haven't been able to answer the two below problems.
I'm compiling a pre-written C program, a very small DOS command line tool, and was wonder if there was a quick and easy way for me to incorporate errorlevel's.
What i'm really wanting to do is launch the program from a bat file, and if the program exits with an error, the bat file skips to the end and finishes.
The bat file part I can do, bat programming isn't a problem.
Code:
if errorlevel 1 goto end
The problem is incorporating the errorlevels / exit codes into the C program.
Any idea's ?
The other problem i'm having is i'd like the DOS command line program to play a wav file when it finishes, so I know that its finished.
I'm really not good with C yet so any pointers would be very appreciated :)
Thank you in advance