It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center
                            
                        
                    
                
                                7年前关闭。
            
                    
如何在C ++中从枚举添加,删除值?
例:
        如果我有上课的学生:

 class Student {
string Name;
string fathername;
string sername;
unsigned int    id-std;
unsigned int    old;




int faculty = 0;
 enum { prog , econ , sport };

  add fac(  );

  delete fac (  );

最佳答案

C ++中的enum是一组命名的整数常量,它在编译时求值,因此您不能像这样添加或删除值。

关于c++ - 如何在类(class)学生的枚举中添加和删除值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13246148/

10-12 17:19