Flags, enum (C)

后端 未结 6 1487
既然无缘
既然无缘 2021-02-02 14:54

I\'m not very used to programming with flags, but I think I just found a situation where they\'d be useful:

I\'ve got a couple of objects that register themselves as lis

6条回答
  •  攒了一身酷
    2021-02-02 15:32

    You should make the flags only powers of two, i.e. each is a bit in whatever data type you're storing this in, and nothing overlaps when you bitwise OR.

提交回复
热议问题