Getting exit status code in C

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Been battling with this issue all day today, your video has saved me. Thank you!!

hylmrdq
Автор

I have compiled your code many times, child always returns 1 on success and failure both. I wonder why ...

dhananjaygola-dl
Автор

another problem i faced is the return status gets modulo by 256, so when you return 256 in this case it's actually like you returned 0 and it show "success" even thought "ping" is misspelled

yassinemakhlouf
Автор

so far I spent literally hours on your channel
not done yet
so next one goes now
your way of explaining really matches my ways of learning ;-)

zyghom
Автор

But if you misspell the program name (pong instead of ping), you will get the "Could not find the program" message and also the "Success!" message, because the statusCode was 0 even though _execlp() could not find the program.

poincareelcartografo
Автор

Thank you, very useful courses, keep going sir.

joroh_
Автор

How to differentiate between the exit code 2 when received from the childprocess because ping was misspelled or the 2 that got returned from the ping program because the domain name was misspelled

yassinemakhlouf
Автор

1 hour trying to get error codes from a child process and in 5 minutes you gave me the answer. Love your channel :-D

albertocaravantesarranz
Автор

I want to create a c/c++ program to run MULTIPLE (say 10) c/c++ programs please help 🙏

ShivamSharma-nbgh
Автор

Perhaps you will answer this question later in this series, but I am wondering how to see the exit code when I run main or some other binary from the command line. Especially when I compile and run with VS Code, the 0 from return 0 is not shown in the Terminal. Thanks!

ShannonWare
Автор

So the user can click that link and it takes them to google??

miaaaslifestyle
Автор

there is a way to execute a command and get the stdout and the exit code?
i know i can get the output using popen(), but with this function i can't get the exit code
any suggestion, or something I can start from

madvillain
Автор

I am newbie, so just curious, the wstatus is just an integer right? Can it have a different name or is it a part of some nomenclature to follow?

Be_Deep_In_Thoughts
Автор

Hello, can you tell me how I can receive a value from the child process when it receives a signal?! To clarify, the parent sends a signal to the child, and the child should return a pontuatuion (int). Ty, love your videos!

migueldomingues
Автор

i would be really surprised if your hight is 2m xd xd

andelephantscanfly