const String array
I need to defined a const string array can I do this:
char *list[5] = { "item1" , "item2" , "item3", "item4", "item5"}
You can do this:
The strings themselves are allowed to be of variable length, but the string array has only 5 elements. Modify as necessary.
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.
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?)
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
Popular Topics
Advertisement