【发布时间】:2020-07-25 10:25:21
【问题描述】:
"some_function" 接收一个指向字符的指针——它的定义如下:
void some_function(char *c);
据我所知,当我们想要调用“some_function”时 - 我们应该使用 '&' 运算符将 an 传递给参数:
some_function(&some_char);
但我见过“some_function”直接接收字符串的工作示例:
some_function("some string");
它是如何工作的?是否推荐这种做法?
【问题讨论】: