+ 1
I have a doubt in C!
In enum function we have (say) a,b,c,d then if we mark b=10 then does it imply that c should be always greater than 11 if c is also mentioned to be 3(for some value which is less than b)? Please clarify my doubt and I am stuck with this illustration about the enum function!
4 Réponses
+ 3
This is fine
enum myenum{a, b = 10, c = 3, d};
a = 0;
d = 4;
+ 2
rodwynnejones Thanks sir!
+ 2
yes if you mark b=10 automatically c=11, d=12 and a=0.. and also you can assign 3 to c, so d would be 4 and so one.. so if :
enum val{a, b, c=5, d, e, f=0, g}; -->
a=0 b=1 c=5 d=6 e=7 f=0 g=1
+ 2
Amine Laaboudi Yeah thanks for clearing my doubt!