how do I wait for input for a text character or string?
ie:
main (int argc, char *argv[]) {
while ( argv[0] != NULL) {
printf("Enter Selection Please: "); // I want it to wait here for input
if(argv[0] = "m") {
how do I wait for input for a text character or string?
ie:
main (int argc, char *argv[]) {
while ( argv[0] != NULL) {
printf("Enter Selection Please: "); // I want it to wait here for input
if(argv[0] = "m") {
Just call an input function on stdin (getchar, for example).
My best code is written with the delete key.
That helps... But how do I get it to wait...
Code:main (int argc, char *argv[]) { printf("Enter Selection Please: "); <-- WAIT HERE FOR INPUT... char x = getchar(); if(x = "m") { do stuff;; }
>But how do I get it to wait...
Unless you changed your shell to raw mode, asking for input should block. Maybe you should be more specific about what you mean by "wait", and how it's not presently waiting.
My best code is written with the delete key.