Read from txt

What is the easiest way to read the first char from a txt? I figured out an extremely over complicated way that looks like a prime example of inefficient programming but was hoping there was a better way. I had an if statement inside the while(getline(x.txt, y)). Any help or advice would be great thanks!
Just open the file and read the first character.
1
2
3
4
    std::ifstream is("stuff.txt");

    char ch;
    is >> ch;
You might want to add std::noskipws.

is >> std::noskipws >> ch ;

Without it, you would read the first non-whitespace character.
Topic archived. No new replies allowed.