Q: Enum within Struct I'm new to enum and struct, I'm getting difficulty on how to debug this code. As long as I know, this code is already true and it should output 0 since male is at 0 position inside the gender.
#include <bits/stdc++.h>

using namespace std;

struct Employee{
   int number;
   enum gender{Male,Female};
   enum language{English,Mandarin};
   enum experience{onetofiveyears,fivetotenyears};
}personality;

int main(){
    personality.gender d = Male;
    cout << d;
}

I have no idea on how to fix this. I hope you guys want to help me cause I already did some research and it didn't work. Thank you for your help.

A: You need to reference the enumeration using scope resolution.
Employee::gender d = Employee::gender::Male;
std::cout << d;

