I'd make a basic C rpg game and I want to save data such as Exp, name, gold, ect.
How can i do it in C?
I went to c++ forum and saw it but fstream doesn't work on C.
thank You
I'd make a basic C rpg game and I want to save data such as Exp, name, gold, ect.
How can i do it in C?
I went to c++ forum and saw it but fstream doesn't work on C.
thank You
>How can i do it in C?
File handling examples for C are all over the place, but I'm guessing you didn't bother to search this forum. Here's yet another example:
#include <stdio.h>
int main ( void )
{
FILE *out = fopen ( "filename", "w" );
if ( out != NULL ) {
fprintf ( out, "Gold: 123" );
fclose ( out );
}
return 0;
}
>I went to c++ forum and saw it but fstream doesn't work on C.
Well, duh. C++ isn't C.
Thanks!
lol
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.