passing arg 1 of `foo' from incompatible pointer type

后端 未结 3 1054
囚心锁ツ
囚心锁ツ 2021-01-26 10:11

Why this shows warning:

#include
foo (const char **p)
{ 

}

int main(int argc , char **argv)
{
    foo(argv);
}

But following

3条回答
  •  忘了有多久
    2021-01-26 10:32

    Depending on your compilation flags, you might need an explicit cast when assigning cp's content to ccp.

提交回复
热议问题