From the book 'Teach Yourself C' by Herbert Schildt page 250 it says to allow spaces to be input using the scanf function use a scanset like so:
scanf("%10[0-9a-zA-Z ]", str);
I found that this did not work for me as it still wouldn't allow me scan in spaces. So I experimented with the following:
scanf("%10[0-9a-zA-Z\ ]", str);
This line works but my compiler issues a warning:
warning C4129: ' ' : unrecognized character escape sequence.
My compiler is MSV C++6.0 on a XP system.
What is the correct way to do this?
Thanks in advance!