On Tue, Feb 23, 2010 at 9:22 AM, Jimmy Johnson <[email protected]> wrote:

> Using visual studio 2008 express...
>
> I can not open a file; f.is_open() is false.
>
> ifstream f;
> int num_patches;
>
> f.open ("teapot.txt");
> if (f.is_open()) {
>        while (! (f.eof())) {
>                f >> num_patches;
> ...
>
> So where do I put the "teapot.txt" file?  I have tried several directories.
>
> Perhaps there's another problem?  I'm new to c.

It's not a question of where you put the file, it's a question of
telling your program where it is. You need to give the full path to
the file, not just the filename.

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
    If I were to divulge it, it would overturn the world."
               -- Jelaleddin Rumi

Reply via email to