char *s;
doesn't allocate any memory for the scanf read - it just declares a pointer - so you need to use (for example)
s = malloc(100);
to get enough space for a 99 character string (plus the terminating nul) iirc
the issue then is, how do you ensure your user doesn't type more than 99 characters ? - and the answer is, using scanf like this, you cant - its 'dangerous'
[edit] I have seen talk of a specifier for scanf, that alludes to using "%ms" gets scanf to allocate the memory for you, but, I cannot attest to this form of usage [/edit]
[edit] I seem to remember that you could also a length specifier with scanf, but, you'd still have to use the malloc or declare s as an array of char, and, it gets messy when the user types over the number of characters you've allowed for [edit]
- you should use something safer, like fgets() instead
'g'