initialize char*

I have searched a lot, but they are not very useful. The following is what I ran successfully in Visual Studio 2017. I will add more later.

char * cannot be initialized directly. If you use the strcpy() function, VS will remind you that it is not safe. You need to use the strcpy()_s function. It is really troublesome. I just want to find a simple initial method.

char ch[]="hello world";
char *str = ch;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325483772&siteId=291194637