I'm after a way to read user input in C, ideally as whitespace-separated strings.
Basically, I'm after something that works exactly the same way *argv[] works when launching the program, but using it for prompting/interaction.
eg.
and I can use argv[1], argv[2], argv[3] to read these strings and argc to check how many arguments were given.
but what about when my program is running and I need user input:
or
Is there a simple way to read the blue bits from the user in a way that works like *argv[] on program execution?
Thanks
Basically, I'm after something that works exactly the same way *argv[] works when launching the program, but using it for prompting/interaction.
eg.
Code:
$ [color=blue]./program new 2 green[/color]
but what about when my program is running and I need user input:
Code:
Enter command: [color=blue]save /file.txt[/color]
Code:
Enter command: [color=blue]set strength 10[/color]
Is there a simple way to read the blue bits from the user in a way that works like *argv[] on program execution?
Thanks