I want to add data into my array similar way as this C++ code.
String a[3][4] = {
{"Burger", "6", "b", "u"} , /* initializers for row indexed by 0 */
{"Pizza", "5", "p", "z"} , /* initializers for row indexed by 1 */
{"Kebab", "4", "k", "b"} /* initializers for row indexed by 2 */
};
In objective-C, my attempt.
NSString *a[10][20] = {
{@"Burger", @"6", @"b", @"u"} , /* initializers for row indexed by 0 */
{@"Pizza", @"5", @"p", @"z"} , /* initializers for row indexed by 1 */
{@"Kebab", @"4", @"k", @"b"} /* initializers for row indexed by 2 */
};
I am not sure if above example works, I will test it once I access to a MAC.
My question is:
What is the right way of doing it, perhaps the best way.
And will my Objective-C code work?
I apologize for asking this question without testing it due to no-access to a MAC.