how do i get getchar() to work twice.
example
char *bleh= getchar();
char *hmm= getchar();
or is there a better function for getting a string, actually?
Printable View
how do i get getchar() to work twice.
example
char *bleh= getchar();
char *hmm= getchar();
or is there a better function for getting a string, actually?
fgets()
Your example is wrong, because getchar, as the name implies, gets a char, not a string. Second, your pointers don't actually point at anything, so that would be an incorrect assignment.
Consider reading the FAQ on getting a line or string from the user.
Quzah.