Torbjørn Kristoffersen wrote:

> I'm wondering if there is an easy way to make a C program that asks the
> user for his whole name, and stores the whole name in a string.
> If I use:
> 
> "scanf("%s",name);"
> 
> It'll only pick up the first word in his name.
> 
> Maybe if I use getch() and store every letter in a string, even spaces,
> but there must be an easier way to do this..

What determines where the name ends? If you wish to read an entire
line, use fgets().

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to