For Programmers: Free Programming Magazines  


Home > Archive > VC STL > February 2006 > can't open a file in vc++ 6









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author can't open a file in vc++ 6
Giff

2006-02-23, 7:05 pm

hi all,

this trivial piece of code is driving me crazy:

#include <fstream>

int main()
{
std::ifstream iff("test.txt");

if (iff.is_open()) printf("Hello World!\n");
return 0;
}

it won't open the file test.txt! the file is in the same directory of
the executable and I also tried with the absolute path... what can it be?
Giff

2006-02-24, 7:58 am


sorry for bothering, I solved with a good night sleep
ZhangQH@asiaInfo.com

2006-02-24, 7:03 pm

How are you solved it ?

Giff

2006-02-25, 7:00 pm

ZhangQH@asiaInfo.com ha scritto:
> How are you solved it ?
>


well it was just that the file I was trying to open was actually called
test.txt.txt instead of test.txt

I solved it leaving the computer for a while ;)
ZhangQH@asiaInfo.com

2006-02-26, 9:59 pm

^_^
I had been checked my file name,It is seem diffent with your problem.
thx

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com