TALLER CEFOP

CEFOP - Mauricio Reyes Schencke

Foros

Responder Responder | Buscar | Ultimo mensaje | Full review

aPEvIGDySJVshbk

 
Marzo 09, 2022 at 10:19 AM

Million Global Leads Pvt. Ltd. matches clients looking for immediately accelerated traffic
MGLS
SEO company
Local SEO company
Best SEO Company

Quote Quote

 
Marzo 09, 2022 at 11:50 AM

  wrote :

There is a reason why C ausemsd that every function returns int, unless specified otherwise: it's the cheapest way to pass the value to the caller. On practically any implementation, return value is in the register. If the caller doesn't use the return value, it doesn't cost him anything.Now, once you know this, you can see that the most convenient error handling mechanism in C is by using return values.Now "main" is the function that is called by the run time library which is called by the operating system. And RTL and OS have its declaration as int main no matter how you declare main in your text.So int main is expected to signal to the caller if the program execution was succesfull. If you don't return anything, the caller will get the garbage, whatever was in the register at the moment of the return.So you should really get used to this idiom. It's very convenient too.

Quote Quote

 
Marzo 09, 2022 at 11:53 AM

  wrote :

There is a reason why C ausemsd that every function returns int, unless specified otherwise: it's the cheapest way to pass the value to the caller. On practically any implementation, return value is in the register. If the caller doesn't use the return value, it doesn't cost him anything.Now, once you know this, you can see that the most convenient error handling mechanism in C is by using return values.Now "main" is the function that is called by the run time library which is called by the operating system. And RTL and OS have its declaration as int main no matter how you declare main in your text.So int main is expected to signal to the caller if the program execution was succesfull. If you don't return anything, the caller will get the garbage, whatever was in the register at the moment of the return.So you should really get used to this idiom. It's very convenient too. Typically 0 means "everything ok" and other values specific error codes. Take a look at the simplest example: f1 = fopen( if ( !f1 ) return 1; f2 = fopen( if ( !f2 ) { fclose( f1); return 2; } ... return 0;(Off topic: Thanks for a very good blog, I often find interesting stuff here)
Moviesflix Pro 9xflix Isaimini Moviesda
Torrentcounter Tamilgun Isaimini Filmywap
MP4moviez MLSBD KatmovieHD

Quote Quote

Responder


Administrador(es) del curso CEFOP : Mauricio Reyes Schencke
Administrador de Plataforma E-Learnig Claroline :
Impulsado por Claroline © 2001 - 2011