From: JustinFL Newsgroups: comp.os.msdos.djgpp Subject: Help with my program Date: Mon, 16 Aug 1999 23:00:27 GMT Organization: Deja.com - Share what you know. Learn what you don't. Lines: 35 Message-ID: <7pa565$sq1$1@nnrp1.deja.com> NNTP-Posting-Host: 4.14.250.149 X-Article-Creation-Date: Mon Aug 16 23:00:27 1999 GMT X-Http-User-Agent: Mozilla/4.61 [en] (Win95; I) X-Http-Proxy: 1.0 x24.deja.com:80 (Squid/1.1.22) for client 4.14.250.149 X-MyDeja-Info: XMYDJUIDjustinfl To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I'm having trouble reading text from a file. I was told to give my program example and you guys would help. What i'd like to know is why this program isn't outputting a line of text from a file. the file does exist, i didn't add the check for file thing in there to keep it short. But how come this isn't working. Also, someone told me that it's not good to use streams because they're not as good as the C routines for reading text from a file. I'd like some input on that. Also, I keep all my source files in /justin/djgpp/bin .....is that where you all would recommend me keeping them. Occasionally I'll have a message pop up saying the compiler couldn't find my source code. If i add a path command to my autoexec.bat file, shouldn't the compiler be able to find the source anywhere within the PATH='s specifications. These aren't big problems, but I really want to know how to make the source code below work how i want it to......: //Start here cout << "File.ext (12 chars max): "; cin >> infile; ifstream inA(infile); if (inA) cout << "File opened correctly, proceeding with execution" << endl; else cout << "File was not opened correctly" << endl; char i[80]; inA >> i; cout << i; inA.close(); //Ends here Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.