Is there any way to make the compiler remember the last integer value it wrote to a file.

i declared the value as a static but after i write to the file ,the value goes back.

You mean after you re-start the program? The way to do that is to make the program open the file and read the value of the variable(s) that was written. If the file does not exist then the program should do nothing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.