Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the difference between C# and C++ enumeration

Shulou Source: shulou.com Published: 2022-05-31 19:25:34 11月14日 Update

This article introduces the relevant knowledge of "what is the difference between C# and C++ enumeration". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The difference between C++ and C# enumerations I. C++

Each element in an enumerated type can be used directly without having to go through the type. The method of the element is called

No + + operation

# include using namespace std;enum week {Monday,Thuesday}; int main () {week day; day = Monday; day = Thuesday; / / day = 4; error type conversion / / day++; error, no + + operation cout

Tags: Types members elements outputs information content names cardinality more cases knowledge practical ordinary successful learning next dilemmas fields actual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Apple Linux Redmi NVidia