私はポインタ文字配列を持っています
void main(){
char* array[] =
{
[0] = "foo",
[1] = "bar",
[2] = "baz"
};
read(array);
}
を使用して長さを取得しようとするときstrlen
int read(const char* events[]){
int size_of_events;
size_of_events = (strlen(events));
}
次の警告がスローされます。
warning: passing argument 1 of ‘strlen’ from incompatible pointer type [enabled by default]
In file included from test.c:6:0:
/usr/include/string.h:395:15: note: expected ‘const char *’ but argument is of type ‘char **’
何が問題なのか理解できません..