这是代码:
#include <iostream>
#include <string>
#include <cstdlib>
#include <sstream>
int main()
{
char str1[100];
char str2[100];
getline(str1,100,'\n');
getline(str2,100,'\n');
return 0;
}
我想读取字符串并将其存储在数组中,因此我正在使用此方法,但它在编译时显示以下错误
[Error]138: error: `getline' was not declared in this scope
在数组中读取字符串的方法是什么?