Please read my post #12: we appear to have posted at almost the same time.
Type: Posts; User: laserlight
Please read my post #12: we appear to have posted at almost the same time.
This:
scanf("%s", &name);
should be:
scanf("%s", name);
since name will be converted to a pointer to its first element.
As stated earlier, remove the fflush(stdin).