[英]IntelliSense Error C Programming
我正在进行C分配,并且在以下代码中遇到了一些错误
char BA[20] = "Hellow there";
char *pBA;
*pBA = &BA;
在代码的*和&下的第三行中有一个红线。 我收到这些错误:
反正有解决办法吗?
一个好的方法是-
char BA[20] = "Hellow there";
char (*pBA)[20] = &BA;
要么
char BA[20] = "Hellow there";
char (*pBA)[20] = NULL;
*pBA = &BA;
就是说,数组指针在C语言中很少见,而是使用指向指针的指针。
实际上,错误在第3行。
char BA[20] = "Hellow there";
char *pBA;
pBA = BA; //Note :- Address must be passed to a pointer, not to value at the pointer, *pBA means value at pBA
这将解决您的目的! 希望您发现了错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.