I've read some post on sent by pete and other experts, and have doubts
on following lines of code.
1.
I think the xstr macro isn't needed, is it safe to just use the str
macro in the following scanf statement instead of xstr?
#define STRINGLENGTH 100
#define str(x) # x
#define xstr(x) str(x)
scanf("%" xstr(STRINGLENGTH) "[^\n]%*[^\n]", string);
getchar();
2.
The following scanf is the equivalent of the above scanf. If the users
input 200 characters at terminal, the chars 101~200 remains in stdin
and the next getchar call just read and discard one char, and there
are 99 characters still remains in stdin. Am I right? Masters, can you
teach me.
scanf("%100[^\n]%*[^\n]", buff);
getchar();