void main is undefined - use int main instead!
Indent properly. Here's how it should look.
Don't use scanf to read a string. Read my signature. Read it carefully. I would rather see that scanf gone the next time you post sample code, please.
Code:
#include <stdio.h>
int main()
{
FILE *fp; /*Declare file pointer*/
int number=4;
char me[20];
printf("Enter a name?");
scanf("%s", &me);
fp=fopen("test.txt","w+r"); /*Open file for writing*/
fprintf(fp,"%d", me); /*Print number to file*/
fclose(fp); /*Close file*/
}
To save a string to file, you can use fputs. You can read a string with fgets.