then wht about enum and struct i'm confused???
Arrays & Enum
Sir, my question is if Array is a collection of similar data type?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Oct 28, 2013, 3:01 AM EDT
The type of these constants is int by default unless you specify a different integer type such as byte or long when declaring the enum.
A variable of an enum type can only be set to one enum constant at a time unless the enum is decorated with the Flags attribute which enables values to be combined.
A struct is similar to a class except that:
1. It usually represents a type with a small memory footprint (no more than 16 bytes) so that it can be copied without affecting performance. The basic types such as int, long, byte, double, float, decimal, bool and char are all C# aliases for structs defined in the .NET framework.
2. Structs are value types. This means that a variable of a struct type holds an instance of the struct itself not a reference to it as would be the case with classes which are reference types.