Skip to main content
gamedev.net
🔒 Locked

scanf Source Code

Started by Cornflake420 Jan 29, 2006 at 4:35 PM 4 replies 2k views
Original Post
Cornflake420
Cornflake420
I need the source code for a replacement function for the C function scanf. It should support the majority of the standard flags, options, and data types. I already tried a Google search and an Ask Jeeves search, but I couldn't find anything. I would appreciate it if someone could tell me where to find the source to a scanf replacement. Please don't ask why; I need this because my project can't use standard libraries
nolongerhere
nolongerhere
I dont see what the difference from using the scanf that comes with your compiler and a different one...sorry I could be of more help, I dont have a scanf function, maybe I can write you one.
SiCrane
SiCrane
You can look at the glibc source files. It should have a scanf() implementation.
Sijmen
Sijmen
The glibc implementation of scanf is a wrapper around _IO_vfwscanf, which can be found in stdio-common/vfscanf.c. But beware: it isn't a simple implementation. It contains lots of difficult looking optimalizations and #ifdefs.

FYI, I've pasted the source here:
Implementation
Cornflake420
Cornflake420
Thanks. That source code was what I was looking for.
Sijmen
Sijmen
Quote:
Original post by Cornflake420
Thanks. That source code was what I was looking for.


And ehm, forgot to mention it, but you should be aware that this code is licensed, under the GPL. You can't just use it for whatever you want without open sourcing that, too. ;)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.