   This is doing my head in....
  the code below is ment to read the first char of every line of a .txt fileexcept when it comes accorss grouped returns it has a habbit of skipping a line or two iv'e been sitting on this for almost 2-3 hours and im banging my head against the wall with it...Heres the code thats troubleing me:char reader;    //Reads the fileFILE *obj = NULL;obj = fopen("test1.obj", "r"); //Open Fileif(obj == NULL) //Error Check{cout << "file not opened!";}else{cout<< "opened file! :)" << endl;}reader = getc(obj);cout << reader << endl;for (int x = 0; x < 10; x++)   // get 10 lines of info{do    //find the next line value{reader = getc(obj);}while(reader != '\n');reader = getc(obj); //goto next byteif(reader == '\n'){cout << "\n";}else{cout << reader << endl;}   
  What is the first character of an empty line? What do you want to happen in that case?   ;  If you can use the STL, this might be a simpler (and safer) approach:std::ifstream file(path);std::string line;while (std::getline(file,line)){  if (!line.empty())    std::cout << line[0] << std::endl;}Edit: oh, are you reading Wavefront OBJ?  If so, remember that not all OBJ statements are one character long.  You might want to write a function to read the first "word" of the line instead.   ;in Hex the new line chars are 0x0D 0x0A if there is an empty line the returns are ussualy grouped with nothing in between like this:0x0D 0x0A 0x0D 0x0Aif by empty line you just mean space then i just want to to print the space char and continue   ;  Let's step through a sample input.sometext\n\n\nmoretextYou'd want the output:smThe key is that you require 3 '\n' characters in a row to form 2 blank lines in your expected output.You take 's' with your opening getc.In your first dowhile loop, you take the first \n of the 3.Then you use getc again and take the second \n of the 3. You print a blank line.You do your dowhile and take the third \n of the 3.Then you use getc again and take 'm'. You print a 'm'.Instead of do{}while, just use while(){} and you'll get what you want.do //find the next line value{reader = getc(obj);}while(reader != '\n');should be:while(reader != '\n') //find the next line value{reader = getc(obj);}