When I try to write something new in this file, it deletes what was saved before, is always saving on what it had before, can anyone 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);