相关疑难解决方法(0)

char s []和char*s有什么区别?

在C中,可以在声明中使用字符串文字,如下所示:

char s[] = "hello";
Run Code Online (Sandbox Code Playgroud)

或者像这样:

char *s = "hello";
Run Code Online (Sandbox Code Playgroud)

那么区别是什么呢?我想知道在编译和运行时的存储持续时间实际发生了什么.

c string constants char

495
推荐指数
6
解决办法
33万
查看次数

char a [] =?string?有什么区别?和char*p =?string?;?

正如标题所说,有什么区别

char a[] = ?string?; and 
char *p = ?string?;  
Run Code Online (Sandbox Code Playgroud)

这个问题在接受我采访时被问到了.我甚至不理解这个说法.

char a[] = ?string?
Run Code Online (Sandbox Code Playgroud)

什么是?运营商?它是字符串的一部分还是具有某些特定含义?

c++ pointers

47
推荐指数
5
解决办法
6万
查看次数

标签 统计

c ×1

c++ ×1

char ×1

constants ×1

pointers ×1

string ×1