gpt4 book ai didi

c - 了解函数/参数中的星号 "*"

转载 作者:行者123 更新时间:2023-11-30 21:21:14 24 4
gpt4 key购买 nike

我试图了解以下内容之间是否有任何区别:

bool String_Init(String *str, char * s, uint32_t len){};

bool String_Init(String *str, char *s, uint32_t len){};

另外,

const char * String_GetCString(const String * const str){};

const char *String_GetCString(const String * const str){};

谢谢!

最佳答案

更详细的解释here ,对于任何类型 T,表达式 T* 表示“指向 T 的指针”。星号是放在函数名中的参数名上还是放在指针类型所引用的类型名上并不重要。参数声明 T* argT *arg 是相同的。

关于c - 了解函数/参数中的星号 "*",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27400378/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com