如何从objective-c中的Static Char访问值

时间:2013-09-26 11:04:49

标签: iphone objective-c xcode

我将值声明为Char的静态集合,

   static char month[][15]={"January","February","March","April","May","June", "July","August","September","October","November","December"};

现在,我想在定义的char月[15]中访问索引5的值;

Objective-c的可行性如何?帮助我。

1 个答案:

答案 0 :(得分:2)

您可以使用月[索引]

访问它
NSLog(@"%s",month[5]);

与您在 C ..

中使用char数组相同