Do these statements about pointers have the same effect?

后端 未结 4 1154
梦毁少年i
梦毁少年i 2020-11-27 05:59

Does this...

char* myString = \"hello\";

... have the same effect as this?

char actualString[] = \"hello\";
char* myString          


        
4条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-27 06:19

    No. In the first one, you can't modify the string pointed by myString, in the second one you can. Read more here.

提交回复
热议问题