回答編集履歴

3

微修正

2018/07/24 12:34

投稿

episteme
episteme

スコア16614

test CHANGED
@@ -30,6 +30,10 @@
30
30
 
31
31
  cout << *str.c_str() << endl;
32
32
 
33
+ cout << str.data()[0] << endl;
34
+
35
+ cout << *str.data() << endl;
36
+
33
37
  char c; str.copy(&c,1);
34
38
 
35
39
  cout << c << endl;

2

微修正

2018/07/24 12:34

投稿

episteme
episteme

スコア16614

test CHANGED
@@ -30,6 +30,10 @@
30
30
 
31
31
  cout << *str.c_str() << endl;
32
32
 
33
+ char c; str.copy(&c,1);
34
+
35
+ cout << c << endl;
36
+
33
37
  }
34
38
 
35
39
  ```

1

微修正

2018/07/24 09:08

投稿

episteme
episteme

スコア16614

test CHANGED
@@ -16,19 +16,19 @@
16
16
 
17
17
 
18
18
 
19
- cout << str[0] << endl;
19
+ cout << str[0] << endl;
20
20
 
21
- cout << str.at(0) << endl;
21
+ cout << str.at(0) << endl;
22
22
 
23
- cout << *str.begin() << endl;
23
+ cout << *str.begin() << endl;
24
24
 
25
- cout << *begin(str) << endl;
25
+ cout << *begin(str) << endl;
26
26
 
27
- cout << str.front() << endl;
27
+ cout << str.front() << endl;
28
28
 
29
+ cout << str.c_str()[0] << endl;
29
30
 
30
-
31
- return 0 ;
31
+ cout << *str.c_str() << endl;
32
32
 
33
33
  }
34
34