I think i have a beginners question.

I try to read a file line by line.

The file is in /home/myhomedir and called text.txt . 
The content of the file is

```
1
2
3
4

```

The file has access right for everyone to read and write.

I wanted: open the file and read it one line after another.

So I tried: 

```
#include <cstdlib>
#include <iostream>
#include <fstream> 

using namespace std;

int main(int argc, char** argv) 
{
    try
    {
        ifstream myfile ;
        myfile.open("/home/myhomedir/text.txt", ios::in);
        if(myfile.is_open())
        {
            string line;

            while (getline(myfile, line)) {
               // do nothing, just get a line
               // *
            }
        }
    }
    catch(int ex)
    {
    }

    return 0;
}

```

The place marked with \* is reached (used the debug feature of netbeans). however line is empty and loop seemed to be entered only once.

Like if an empty file is opened.

What am I doing wrong?