C++ getline()

1 개요[ | ]

C++ getline()
C++
Copy
#include <iostream>
#include <sstream>
using namespace std;

int main() {
    stringstream ss("hello world");
    string temp;
    getline(ss, temp, ' ');
    cout << temp << endl; // hello
    getline(ss, temp, ' ');
    cout << temp << endl; // world
}
Loading

2 같이 보기[ | ]