摘要:
首先定义一个string s,char c[10]; 在C++中,可以直接用cin>>s或者cin>>c输入,用cout<<s或者cout<<c输出; 而在C中,char类型可以用scanf("%s",c)输入,string类型只能用其构造函数string str( "Now is the time 阅读全文
摘要:
头文件:<string> getline()的原型是istream& getline ( istream &is , string &str , char delim ); 其中 istream &is 表示一个输入流,譬如cin; string&str表示把从输入流读入的字符串存放在这个字符串中( 阅读全文