const String array

Started by
3 comments, last by Nullio 22 years, 5 months ago
I need to defined a const string array can I do this: char *list[5] = { "item1" , "item2" , "item3", "item4", "item5"}
Advertisement
You can do this:
char arr[5][] = { "item1", "item2", "item3", "item4", "item5" }; 

The strings themselves are allowed to be of variable length, but the string array has only 5 elements. Modify as necessary.
Those are both the same thing...

[Resist Windows XP''s Invasive Production Activation Technology!]
True. The second is just more "expressive." And rather than asking whether you can, try it!

Thanks for the lookout, Null and Void (can I call you N&V?)
quote:Original post by Oluseyi
True. The second is just more "expressive." And rather than asking whether you can, try it!

Exactly why I didn''t respond in the first place, I figured he''d go try it on his own eventually .

quote:Original post by Oluseyi
Thanks for the lookout, Null and Void (can I call you N&V?)

I don''t care how people abreviate my name , I''ll sometimes even type it as ''nav'' since it is somewhat awkward to type out.

[Resist Windows XP''s Invasive Production Activation Technology!]

This topic is closed to new replies.

Advertisement