exit() function | C Programming Tutorial

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

This was an excellent explanation. Clear simple and to the point. Thank you so much.

MrSkyydude
Автор

Nice sir ek dam accurate whii btaya apne video m jo tittle h aur jo janna tha thankyou sir

digpaladhikari
Автор

Thank you for uploading, I just wanna point out that "echo $? " command on windows 10 outputs "true" or "false" to indicate the exit status of our program
true : for return 0/EXIT-SUCCESS
false: for return 1/EXIT-FAILURE

justcurious
Автор

Thanks, bro
I wanna just know the difference between the "exit", "quick_exit" and "at_quick_exit" functions
It would be nice if you made a vid about it 😍😍

moatazahmed
Автор

Hi Kevin,

Some C functions return different values of 0 or 1 so that we can make decisions.

For example, sokect() returns -1 if the socket creation fails.

Having control over the values to be returned to the OS allows us to communicate what happened in our program in a personalized way, for example:

-1 = File creation failed
-2 = File does not exist
-3 = Not enough space
-4 = Unauthorized user

However, if we do: exit(-1) shows the value 255 in echo $? instead of the negative number, exit(-2) shows the value 254 in echo $?

What could this be due to?

Thanks and as always another great video!

angelffg
Автор

thanks for the info, it cleared up a misunderstanding I had. But what does the bash-3.2$ do? Also does return only send values to the shell?

nvshinies
Автор

you said that "return 1" means program terminates unsuccessfully but can you tell me what actually was wrong in the code I mean its perfectly fine we have our desired out "Hello world!" so I am confused about this

maazsiddiqui
Автор

We can use return only in function instead?

dragonballzsuper
Автор

Does anyone know how you get the return value - what is done in the video with $ echo $? or something?

mortenlund
Автор

I am learning C so I can hack my crushes computer and tell her I love her.

X-VIPRIN
welcome to shbcf.ru