Hello!
I have a problem with the getline function for the string class. What I am doing is trying to pass class string member to the getline function.
something like:
How to pass string of a class to getline?
I have a problem with the getline function for the string class. What I am doing is trying to pass class string member to the getline function.
something like:
Code:
#include <iostream>
#include <string>
using namespace std;
class something{
public:
string someString;
};
int main(){
something array[1000];
int i=0;
//Here is the problem...compile error
getline(cin,array[i].someString);
return 0;
}