954,219 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Source code for printf, scanf, cin, cout?

dennis richie made c language with only 32 keywords all the functions and statements are to be created by the programer. if so wher is the source code of "printf" "scanf" "cin" "cout" ?

policeachan
Newbie Poster
3 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

They're found in the source code of a language implementation. That is, Borland C/C++, Microsoft Visual C++, Dev-C++, gnu, etc. (And the implementation of the C or C++ language may itself not be in C or C++.)

What you get when you use C or C++ is a defined interface that will make available to you a function printf that will behave in a well-defined manner. Whether the actual source of printf is written in C or assembly or Pascal or whatever is not supposed to matter.

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

hi all,
can any one help yar its very urgent ............

where is the code for printf and scanf fucntions...

how they will work

sriz6teen
Newbie Poster
5 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

Maybe this will help you understand.
Don't be afraid next time of creating a new thread when you want to ask something. People frown upon old threads that get bumped to a current active state.

Aia
Nearly a Posting Maven
2,392 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 218
 
where is the code for printf and scanf fucntions...


One place you can start with is at the following address: http://www.koders.com/c/fid4E0FA789459803C1E4369279B96E5C9B257941C8.aspx?s=printf#L7

That one is the GNU C's implementation. I think you probably find your way from there on to scanf. And doing a google on the file name gives more results I bet.

mitrmkar
Posting Virtuoso
1,809 posts since Nov 2007
Reputation Points: 1,105
Solved Threads: 395
 

Why not run your code via the debugger and when you get to the printf function step into the function. If on your machine your compiler has the full source code for the libraries (i.e. Win SDK), then you should find the code.

Maybe.

SergioQ
Junior Poster in Training
54 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

Hi all! I' m new in prgramming and i need the source code of scanf(). Is anybody who knows where can I find the code?

bolareq
Newbie Poster
1 post since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

I can easily see this thread being kept alive for four more years with "me too!" posts, so I'm closing it.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You