FILE *f = fopen("namearq", "wb"); //Write binary flag
fwrite(&yourIntVar, 1, sizeof(int), f);
fclose(f);
var.to_s;
4erv' wrote:How to write integer into a text file? "fputs" doesnt work. Or is there any way to convert int to string?
FILE *write=fopen("name.ext","w");
fprintf(write,"%i",integer_variable);
fclose(write);
sprintf(string_var,"%i",int_var);
sprintf(string_var,"%i",&int_var);
Users browsing this forum: No registered users and 1 guest