![]() |
source code of scanf
I want to create a new function myscanf (char *format,...) which does same as scanf() without using any library function other than getchar().
Pls soomeone get it done for meeeeee.plssssssssssss |
Re: source code of scanf
Code:
char c; |
Re: source code of scanf
Quote:
You are still using library function getchar() and putchar(). He is asking if i am correct. Code:
#include "stddef.h" |
Re: source code of scanf
Oh!! At the last of code add one function
va_end ( ap ); |
Re: source code of scanf
Quote:
Shabbir bhai, hi U have helped me really.......... But my problem is not about supporting integer but rather %s,for string datatype char buf[100] %x, for hexadecimal %c for characters please help me little bit more |
Re: source code of scanf
Quote:
Thanks a lot .U r great but my problems are little more tough.I should not use myscanf(char *s,char *fmt,...) Also it should support %c,%x and %s for strings too |
Re: source code of scanf
Quote:
|
Re: source code of scanf
Quote:
I've seen this on another forum, and I've yet to see any code from you. People are not just going to do it for you (hopefully). If you want to cheat, look up some open source code for scanf. |
Re: source code of scanf
Quote:
My program would support to undersand---------myscanf("%d%s%x",a,b[],c); |
Re: source code of scanf
The string parsing and variable number of arguments in a function is all together a diiferent topic and you can check out - OutputDebugString with variable number of arguments for that but I guess your initial requirement is fully satisfied with the code snippet I provided.
|
| All times are GMT +5.5. The time now is 01:46. |