这是我正在编写的代码。
#include <stdio.h>
int main(){
//Declaring and defining a char array also adding up pointer as its elements
/*A char pointer with the stored address returns the value of that address but, an unassigned char pointer returns â as the output
when I do not use an empty variable but, when I use an empty vairable it returns ä as the output*/
char *A;
char B = 'H';
char *H;
char C;
A = &B;
char arr[10] = {'a','b','c','d',*A,*H,C};
//Traversing the array
for(int i=0;i<10;i++)
{
printf("%c ",arr[i]);
}
}
我只是没想到空指针 char 变量中会有这些符号。我只需要对此有一个很好的解释。谢谢你。
您没有给 H 一个值,因此它指向垃圾(您无法知道有关该值的任何信息)。 C同样是垃圾