looks crazy...
try this way:
int score=20;
int main(void){
char* currentUser = "02heasam";
FILE *dataScore;
dataScore = fopen("fileName.dat", "w");
fprintf(dataScore,"%s:%d\n",currentUser,score);
fclose(dataScore);
}
some explanations:
- to fill a char array with a string you would need strcpy or so. Not needed here!
- the order might be important (declaration before usage)
- a strimng literal "xxx" will automatically terminated by a trailing 0-Byte - NEVER miss to have this in mind!