enum don't allocate any memory

it2022-05-05  133

int main() { _asm{ mov edi,edi mov edi,edi } enum Color{Red=12,Green,Yellow}; _asm{ mov edi,edi mov edi,edi } Color c=Red; //The only valid values that you can assign to an enumeration variable without a type //cast are the enumerator values used in defining the type. //c=13; c=Color(54); int count; count=Red+4; return 0; };

然后查看assembly,5: _asm{6: mov edi,edi0041139E 8B FF mov edi,edi 7: mov edi,edi004113A0 8B FF mov edi,edi 8: }9: enum Color{Red=12,Green,Yellow};10: _asm{11: mov edi,edi004113A2 8B FF mov edi,edi 12: mov edi,edi004113A4 8B FF mov edi,edi 13: }可以说明:声明enum don't allocate any memory.

转载于:https://www.cnblogs.com/hongjiumu/p/3498366.html

相关资源:各显卡算力对照表!

最新回复(0)