1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include <iostream>
#include <string>
using namespace std;
int main(){
//string
string str;
getline(cin, str);
//getline(cin, str, '\n');
cout << "str: " << str << "\n";
//char array
char ch[100];
cin.getline(ch, 100);
//cin.getline(ch, 100, '\n');
cout << "ch: " << ch << "\n";
return 0;
출처: https://shjz.tistory.com/96 [밤머리 이야기]
|
cs |