![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Jan 2006
Posts: 58
Rep Power: 3
![]() |
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? |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Jan 2006
Posts: 58
Rep Power: 3
![]() |
Got it.
I was declaring in the function prototypes my infile stream of type "ifstream", when it should be "fstream".... |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|