String constant array?

  • Thread starter Thread starter wonil kim
  • Start date Start date
W

wonil kim

Hello all,

I am new guy on C#. So, my question will be very simple to you guys here.
I want to use string constants array from C# like C++ like below.

in C++ :

char const * const attr_strings[] = {
"NORMAL",
"EDGE",
"SHADOW",
"UNDERLINE"
};

And, use it later like below :

cout << attr_strings[_attr] << endl;

How can I define above C++ like string constant arrays in C#?

Thanks.
 
Hi,
I'm quite new to C# too but I think its something like this:

readonly string[] attr_strings = new string[]{"NORMAL", "EDGE", "SHADOW",
"UNDERLINE"};

hth,
Nick
 
Back
Top