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?
This is a discussion on getchar() to work twice within the C Programming forums, part of the General Programming Boards category; how do i get getchar() to work twice. example char *bleh= getchar(); char *hmm= getchar(); or is there a better ...
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.
Hope is the first step on the road to disappointment.