C++
- voluntas
- @ignis_fatuus
- ブン
- @Linda_pp
- 清楚なC++メイドBOT
- @tzik_tack
- 長谷川一輝
- wraith13
- @jj1bdx
- @cpp_akira
- 安藤敏彦
- @srz_zumix
- Siv3D
- takezoh
- まろ
- @okdshin
- @hnokx
- @ishidakei
- @take_cheeze
- TAKEI Yuya
- @mumumu
- I (@wx257osn2)
- Tommy6
- @tyottyoworks
- ___shanon
- わたやん
- @KorekaraSEDB
- @kariya_mitsuru
- @ciniml
- @beam2d
- @grafi_tt
- @nekketsuuu
- LouiS0616
- @volanja
- 大鎌広
- むてら
- ガチKGB
- 三重野賢人
x
26
1
2
3
4
union hello
5
{
6
struct hi
7
{
8
uint8_t trees;
9
uint8_t plants[6];
10
};
11
uint8_t forest[1 + 6];
12
};
13
14
struct world
15
{
16
hello a;
17
};
18
19
typedef std::vector<world> universe;
20
universe alpha;
21
22
int main() {
23
alpha.at(1).a.trees = 1;
24
}
25
26
$ clang++ prog.cc -Wall -Wextra -std=gnu++2a
Start
prog.cc:23:19: error: no member named 'trees' in 'hello' alpha.at(1).a.trees = 1; ~~~~~~~~~~~~~ ^ 1 error generated.
1
Finish