Pointer to const char vs char array vs std::string

前端 未结 7 2040
不思量自难忘°
不思量自难忘° 2020-12-16 20:48

Here I\'ve two lines of code

const char * s1 = \"test\";
char s2 [] = \"test\";

Both lines of code have the same behavior, so I cannot see

7条回答
  •  醉话见心
    2020-12-16 21:22

    The only difference between the two that you should care about is this:

    Which one is your project already using?

提交回复
热议问题