store - Save increment in C -


i need little i'm writing c.

so have this:

int a; int 1 = 4; int 2 = 3; printf("if have done write '1', if have done write '2' "); scanf("%d" ,&a); if (a=1)    {      1 = one+1;     } else if (a=2)    {     2 = two+1    } 

so thing want save increment next time open program, values of int 1 , 2 change based on last usage of program. how do ?

use fopen/fread/fclose when start application (before write checks if file handle correctly created)

use fopen/fwrite/fclose when exit application.

how access file? basic functionalities, read this: http://www.thegeekstuff.com/2012/07/c-file-handling/


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -