ファイルから特定のデータを読み取る際に問題が発生しました。このファイルの1行目と2行目は80文字で、3行目は不明な文字数です。以下は私のコードです:
int main(){
ifstream myfile;
char strings[80];
myfile.open("test.txt");
/*reads first line of file into strings*/
cout << "Name: " << strings << endl;
/*reads second line of file into strings*/
cout << "Address: " << strings << endl;
/*reads third line of file into strings*/
cout << "Handphone: " << strings << endl;
}
コメントのアクションを実行するにはどうすればよいですか?