I'm just trying to surround a name by a space and a star.
eg.
* John *
but the output I get is:
* John
*
Why is this happening?
Thanks
#include<stdio.h>
char name[30];
int main(int argc, char **argv)
{
printf ("Please enter your name: ");
fgets ( name , 30 , stdin );
printf ("* %s *", name);
return 0;
}