ansari bhai
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

shabbir

1Feb2008 11:31

Re: source code of scanf

Quote:

Originally Posted by gyanu

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

I could not get you.

oogabooga

1Feb2008 21:44

Re: source code of scanf

Quote:

Originally Posted by gyanu

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

Could we please see some of your code?
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.

gyanu

2Feb2008 05:55

Re: source code of scanf

Quote:

Originally Posted by shabbir

I could not get you.

I have to create and implement a function myscanf(char *format,...) wilthout using any library functions other than getchar().
My program would support to undersand---------myscanf("%d%s%x",a,b[],c);

shabbir

3Feb2008 11:29

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.