WebFeb 11, 2024 · 最佳答案本回答由达人推荐. 额,这个函数本身就错了~~,函数被定义为char型,而里面的返回值却是char*型的,编译器会报错的。. 可以在char后面加*,然后如果return的话,p返回的是地址啊~. Webconst char *p="hello"; foo(&p); // 函数foo(const char **pp)下面说法正确的是[] A.函数foo()不能改变p指向的字符串内容。 B.函数foo()不能使指针p指向malloc生成的地址。 C.函数foo()可以使p指向新的字符串常量。 D.函数foo()可以把p赋值为 NULL。 至于这道题的答案是众说纷 …
有以下程序#include int fun( char *s ) {char *p=s;while (*p !=0 ) …
WebNov 13, 2010 · 可以在char后面加*,然后如果return的话,p返回的是地址啊~. 在程序中因为fun函数的返回值为char,而P是指向char的指针变量,因此类型不匹配,所以返回的值 … Web解决方案:. 1. 返回一个指向字符串常量的指针。. 例如:. char * func () { return "Only works for simple strings"; } 这是最简单的解决方案,但如果你需要计算字符串的内容,它就无能为力了,在本例中就是如此。. 如果字符串常量存储于只读内存区,但以后需要改写它时 ... properties of a stainless steel
char fun(char *p) { return p; } - 搜狗问问
WebDec 12, 2024 · 有以下函数char*fun(char*p){returnp;}该函数的返回值是无确切的值形参p中存放的地址值一个临时存储单元的地址形参p自身的地址值. 首页; 题目; 学科; 试卷; 登入; … WebTypedef char *charp; const charp P; A - P is a constant B - P is a character type C - P is a pointer D - None of the above Q 10 - What is x in the following program? #include int main {typedef char (*(*arrfptr[3])())[10]; arrfptr x return 0;} A - x is a character pointer B - x is an array of pointer C - x is an array of three function ... WebMar 7, 2024 · In the above example, the function fun() expects a double pointer (pointer to a pointer to an integer). Fun() modifies the value at address pptr. The value at address pptr is pointer p as we pass address of p to fun(). In fun(), value at pptr is changed to address of q. Therefore, pointer p of main() is changed to point to a new variable q. ladies flat red shoes