Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-10-2003, 05:34 PM   #1
LQ Newbie
Registered: Oct 2003
Posts: 8

Rep: Reputation: 0
concatenating strings to open files

alright, I'm using linux 9.0 and working in c++:
my question is:

if I use the code,
void Node::Read_In ( ifstream &Nin )
Nin.getline ( Kdata, 4, '\n' );
Kdata[4] = '\0';

I keep getting the error message for the Nin.getline ( Kdata, 4, '\n' ); line.

Node.cxx: In member function `void Node::Read_In(std::fstream&)':
Node.cxx:24: invalid use of undefined type `struct std::basic_fstream<char,
std::char_traits<char> >'
/usr/include/c++/3.2.2/iosfwd:92: declaration of `struct
std::basic_fstream<char, std::char_traits<char> >'

the file being passed in was opened by concatenating two strings together s1+=s2, then using the command
ifstream Fin; ( s1.c_str(), ios::in );

any ideas?
Old 11-10-2003, 05:36 PM   #2
LQ Newbie
Registered: Oct 2003
Posts: 8

Original Poster
Rep: Reputation: 0
the can be either ifstream or fstream, I'm getting the same message for both cases.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
group files by strings in dir Melsync Programming 7 12-17-2005 12:53 PM
bash script help (arrays and strings from files) nkoplm Programming 14 12-02-2005 09:50 AM
concatenating files s_siouris Linux - Software 4 05-30-2005 09:36 AM
Searching files for strings tmoorman Linux - Software 4 01-08-2004 01:46 PM
opening files with strings for file names veilig Programming 4 11-10-2003 11:19 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:00 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration