这是个什么格式个getline(cin,s[i])
getline(cin,s[i])是什么意思他和cin.getlines([i])一样吗
还有顺便帮我解释下cin.getlines()我只知道他是输入一个字符串,就我的理解是输入字符串遇到“\n"的时候就停止对吗 ?
istream& getline( istream& is, string& s, char delimiter = '\n' );
The C++ string class defines the global function getline() to read strings from and I/O stream. The getline() function, which is not part of the string class, reads a line from is and stores it into s. If a character delimiter is specified, then getline() will use delimiter to decide when to stop reading data.
For example, the following code reads a line of text from STDIN and displays it to STDOUT:
string s; getline( cin, s ); cout << "You entered " << s << endl;
-----------------------------------------------------------------
cin.getline(str[i]);
-----------------------------------------------------------------
istream& getline( char* buffer, streamsize num ); istream& getline( char* buffer, streamsize num, char delim );
The getline() function is used with input streams, and reads characters into buffer until either: