テキスト ファイルから文を読み取って 2D 配列に格納しようとしています。関数cin.getlineを使用しています。テキスト ファイルの各文を 2D 配列の行に格納しようとしています。read は私の ifstream オブジェクトです。以下は私のコードのサンプルです
for (int i = 0; i < 7; i++)
{
int k=0;
read.getline(people.wishlist[i][k], MAX); // store in row 0 when i is 0
}
// what my text file looks like:
// Hey how is your day
// whats up
私が得ているエラーメッセージ:
error C2664: 'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::getline(_Elem *,std::streamsize)':
cannot convert parameter 1 from 'char' to 'char *'
誰かが私のためにこの問題を解決するための良い方法を提案できますか? ありがとう