To be 100% correct, you should actually remove the & from the line:
scanf("%9s", &userInput);
Because scanf expects a pointer to the buffer, not a pointer to an array, though technically they are the same thing.
If you like reading, here's another good link for you! http://www.research.att.com/~bs/bs_faq2.html#whitespace