Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Obsurd function in MINIX???

Status
Not open for further replies.

ekanth

Programmer
Jul 28, 2001
28
0
0
US
there is a file named putc.c in lib directory within src directory of MINIX source. It has a function named putc which is used by printf of stdio.h. It goes like this

#include <stdio.h>
int
(putc)(int c, FILE *stream)
{
return putc(c, stream);
}

Could anyone explain what this does. We tried a small program in C with the above form but it never ended.
Help
Ekanth & Madhan Treat the daily build of a project as the heartbeat of the project. If there's no heartbeat the project is dead.
 
the function looks to be recursive. It never stopped because it kept calling itself over and over.

matt
 
We could understand that it is recursive but the thing is how will this function work? Andy Tannenbaum uses this function to print characters from the printf function of the stdio.h library. There must be something else other than just being recursive in this case atleast...
Ekanth Treat the daily build of a project as the heartbeat of the project. If there's no heartbeat the project is dead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top