#include <stdio.h>
void main()
{
char me[20];
printf("Name your zodiac sign babey:");
scanf("%s",&me);
printf("So your a %s too!\n",me);
}
#include <stdio.h>
void main()
{
char me[20];
printf("Name your zodiac sign babey:");
scanf("%s",&me);
printf("So your a %s too!\n",me);
}
main always return an int. Other then that it compiled and runed fine for me.Code:#include <stdio.h> int main() { char me[20]; printf("Name your zodiac sign babey:"); scanf("%s",&me); printf("So your a %s too!\n",me); return 0; }
thanx
Actually you're both wrong.
> scanf("%s",&me);
This is wrong.
scanf( "%s", me );
This is right. The reason is that the name of an array is a pointer to its first element. Scanf takes a pointer. Not the address of a pointer.
Quzah.
Last edited by quzah; 05-15-2002 at 03:23 PM.
Hope is the first step on the road to disappointment.