小编Jus*_*tin的帖子

有没有办法在枚举条目中存储多个值?

我是C++的新手,我正在尝试创建一个枚举列表的位置,它们是各自的坐标,但我无法想出一种方法来在一个枚举条目中存储多个整数值.是否有可能做到这一点?

我做了很多环顾四周,但我找不到任何可以说明的方法.

enum Places {

    CITY = //coordinates would be here,
    TOWN = //differnt coordinates would be here

};
Run Code Online (Sandbox Code Playgroud)

任何帮助都会很棒.

c++ arrays enums enumerator

0
推荐指数
1
解决办法
72
查看次数

标签 统计

arrays ×1

c++ ×1

enumerator ×1

enums ×1