Ewww. Please don't advocate the writing of such code. gets is a hideously unsafe call to be making.Originally posted by: daniel49
perhaps you could use 2 vaiables one for first name and one for last? calling scanf twice.
or maybe try using gets()
something like
#include <stdio.h>
char input[81];
main()
{
puts("enter some text, then press enter");
gets(input);
printf("you entered %s" , input);
}
/*try those been quite a while since i played with C*/
Originally posted by: kamper
Ewww. Please don't advocate the writing of such code. gets is a hideously unsafe call to be making.
To the op, scanf is nasty for the same reason (dead simple buffer overflow). Since you're just reading a string anyways, may I suggest fgets?
