Reading a String

I'm trying to write a simple function that reads the text from a designated hosted file and changes a label's text from " Waiting For Update Check " to " Update Available " depending on it's value. I was wondering how I could do so? I understand it somewhat, using " ; " as a delominater to read the text, I just don't know of how to actually write it, if someone could help me or lead me to a tutorial on the subject I'd be grateful.
There are many ways to read from a file, not necessarily using a delimiter such as ';'. It all depends on what you're reading. Numbers? Strings? A combination of both?
For example I'll put a simple text file on my host with the text
40;
and if it doesn't read that then it'll change the label's text.
I don't think you need to use a delimiter if all that is in the file is a number that indicates a state.

You could simply:

1
2
3
4
5
6
7
8
9
10
ifstream infile;
int udstate;
string stateindicator;

    infile >> udstate;

    if( udstate  == 40 )
          stateindicator = " Waiting For Update Check " ;
    else
          stateindicator = " Update Availalbe ";


That is, if I understand the problem fully.
That's more or less what I was aiming for, though how do I indicate the url for checking for the string on the text file.
Store it in a string.

string url="http:\\www.google.com";

I'm not a C++ string expert though. I know that '\' meant an escape character and when you needed '\' literally, you needed to type it twice for each one. I don't know off-hand if C++ strings behave the same.
Topic archived. No new replies allowed.