so i couldnt get getline to work, i didnt realise i needed to put myfile << line; in after writing getline (cin,line);
why is cin in the parenthesis and how does it (getline()) work, also am i right in thinkong i can use .c_string to pop any string reference into anything so i could do say cout << something.c_string () ; (not that i would bother with cout)
why is cin in the parenthesis and how does it (getline()) work, also am i right in thinkong i can use .c_string to pop any string reference into anything so i could do say cout << something.c_string () ; (not that i would bother with cout)
Getline works by taking whatever is in the first argument (a stream such as an ifstream, istringstream or istream) and sticking it in the second argument (a string).