Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 22nd, 2006, 1:15 PM   #1
sackarias
Programmer
 
sackarias's Avatar
 
Join Date: Jan 2006
Posts: 58
Rep Power: 3 sackarias is on a distinguished road
ifstream as ref.

I have a function called "filePrompt", which prompts a user for a file name. I'm passing to it an ifstream called fin, and a string called fileName to obviously store the file name, both are being passed by reference.

The error I'm getting is : error C2664: 'filePrompt' : cannot convert parameter 1 from 'class std::basic_fstream<char,struct std::char_traits<char> >' to 'class std::basic_ifstream<char,struct std::char_traits<char> > &'

It's pointing to where I'm calling the function which is simply filePrompt(fin, fileName);

Anyone got an idea of what subtle things I'm missing to fix this up so I can keep trucking on with this project?
sackarias is offline   Reply With Quote
Old Jan 22nd, 2006, 1:23 PM   #2
sackarias
Programmer
 
sackarias's Avatar
 
Join Date: Jan 2006
Posts: 58
Rep Power: 3 sackarias is on a distinguished road
Got it.

I was declaring in the function prototypes my infile stream of type "ifstream", when it should be "fstream"....
sackarias is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:20 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC