回答編集履歴
1
サンプルソース追加
test
CHANGED
@@ -1 +1,45 @@
|
|
1
|
-
std::
|
1
|
+
std::array で格納してはどうでしょう。
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
```C++
|
6
|
+
|
7
|
+
#include <iostream>
|
8
|
+
|
9
|
+
#include <array>
|
10
|
+
|
11
|
+
#include <vector>
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
int main()
|
16
|
+
|
17
|
+
{
|
18
|
+
|
19
|
+
std::array<char, 4> a{ 'a', 'b', 'c', '\0' };
|
20
|
+
|
21
|
+
std::array<char, 4> b{ 'd', 'e', 'f', '\0' };
|
22
|
+
|
23
|
+
std::array<char, 4> c{ 'h', 'i', 'j', '\0' };
|
24
|
+
|
25
|
+
std::vector<std::array<char, 4>> vec_array;
|
26
|
+
|
27
|
+
vec_array.push_back(a);
|
28
|
+
|
29
|
+
vec_array.push_back(b);
|
30
|
+
|
31
|
+
vec_array.push_back(c);
|
32
|
+
|
33
|
+
for (auto ary : vec_array)
|
34
|
+
|
35
|
+
{
|
36
|
+
|
37
|
+
std::cout << ary.data();
|
38
|
+
|
39
|
+
}
|
40
|
+
|
41
|
+
return 0;
|
42
|
+
|
43
|
+
}
|
44
|
+
|
45
|
+
```
|