Using C++, Can you take a variable from a text file to use in an if, then statement? As in, your program reads a text file from line, say: 5 column 8 to get the number, say: 1. Then use that number like: If 1 then change to 2 and put 2 back in the file on line 5 column 8 and close.
I have tried to write this but as I am an amature it is not working out. I can read the file or write to the file but not both. My script has many errors and won't compile.
Could anyone explain how to do this if it is even possible?
Any help would be appreciated, thank you.
menis2com

Please post the relevent code and tell us what the compile errors ARE.

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.