1
Every time I try to record something new in this file, it erases what was saved before, it keeps saving on top of what it had before, someone can tell me what it is?
arquivo = fopen("dados.txt","w");
aux = x.retorne_energia();
aux2 = x.retorna_nome();
fprintf(arquivo,"%d\t",aux);
fputs(aux2.c_str(), arquivo);
aux = y.retorne_energia();
aux2 = y.retorna_nome();
fprintf(arquivo,"\n%d\t",aux);
fputs(aux2.c_str(), arquivo);
fclose(arquivo);
It worked, thank you!
– OdiumPura