problem using getline function

Joined
Mar 22, 2010
Messages
2
Reaction score
0
I am trying to create a function in my c++ program which reads in strings from a file and assigns them to a variable then passes these variables into an object constructor which is then added to a vector<object>. So far this is what I have:

ifstream load;
string s1="",s2="",s3="";
load.open("myFile.txt");
while(! load.eof())
{
getline(load, s1, " ");
getline(load, s2, " ");
getline(load, s3, " ");

Object newObj(s1,s2,s3);
list.push_back(newObj);
}
load.close();




The error i keep getting is an invalid conversion from void* to char** This error seems to occur in the getline function's second parameter. I am a little new to c++ programming and I am not sure what parameters are supposed to be passed to it. the file it is reading from has every variable separated by a single space.
Any help will be greatly appreciated.
Thanks.
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Getline String Class problem 1
GET NEIL DEGRASSES TYSON, I ripped a hole with this one... 0
adapting getline 77
TF-IDF 1
getline problem 10
getline() issue 0
Getchar() problem 8
function call using reflection 3

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top