Tuesday, 15 September 2015

c - printf flush at program exit -


I know how the flip of the printf () function works when the program exits Is interested in knowing

Let's take the following code:

  int main (int ac, char ** av) {printf ("hi"); Return 0; }   

In this case, how does printf () manage to flush its buffer stdout ?

I think it's up to the platform, then take a Linux.

It can be implemented using the GCC 's __feature__ (dtor) but then the standard library compiler will depend on me It's not the way that it works.

Any explanation or link for the documentation is appreciated. Thank you.

C will run Runtime atexit () to flush the handlers < / P>

See it. Standard buffers when exit ()

No comments:

Post a Comment