scanf doesn´t reads spaces ???

hi all

i have a program in C (Unix Solaris 5.7) and i want to read a string from keyboard, but the "scanf" doesn�t reads spaces.
example:

....
char name[50];
....

printf("Enter your name: ");
scanf("%s",&name);
printf ("Your name is: %s", name);

and if i write Kevin Costner
the program only reads Kevin (that is what shows in the screen)

what can i do?
please help me...
thanks....

jona

That is how ssanf works.

Use 'gets' instead.

give input in quotes"" for example "Kevin Costner"

Never use gets... use fgets instead.

You can use scanset operator [] for this.