Ali se da prepričati prevajalnik, da uporablja za enum unsigned int?
če v enum prirejam vrednost npr. 1U<<31 javi warning, da je int out of range. Načeloma bi lahko priredil vrednost -2147483648, vendar potem izgubim preglednost kode.
Moderator: tilz0R
The underlying type of an enumeration is an integral type that can represent all the enumerator values defined in the enumeration. It is implementation-defined which integral type is used as the underlying type for an enumeration except that the underlying type shall not be larger than int unless the value of an enumerator cannot fit in an int or unsigned int.
Vrni se na C in sorodni jeziki
Po forumu brska: 0 registriranih uporabnikov in 1 gost