September 16th, 2003, 03:12 AM
Join Date: Sep 2003
Time spent in forums: < 1 sec
Reputation Power: 0
a C input question
Hi, guys.....I have a question about keyboard input in C
I m writing a program...
which allows user to type command in the the prompt....then my program will do specified thing and so on
command are in the form: com parameter1 parameter2(or more)
> move queue queue2
> add 12345 aibo queue2
the problem is, I don't know how to get those input...
because scanf can't get the whole string, it's space delimited....
also, since each of my command can have different # of parameters, this makes it more difficult, otherwise, I would have delcare a char* variable for each....
my question is is there any way to get the whole command in one string? then parse it?
or there's a better way to do it??