LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-10-2003, 05:34 PM   #1
veilig
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;
Fin.open ( s1.c_str(), ios::in );

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

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


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:15 PM.

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