Home > Back-end >  C language does not mean that pointer variable is stored in the address of a variable cannot be stor
C language does not mean that pointer variable is stored in the address of a variable cannot be stor

Time:11-22


D option is that this subject because the pointer variable cannot be stored constants is so wrong.

But the time of pointer variable defined in the second question is not use constant 0 to define? Why can be here?

CodePudding user response:

Computer memory or file content or transport it is just a one-dimensional binary byte array and its corresponding binary address;
The human brain to a computer memory or file contents or transfer the content of the one-dimensional binary byte array and its corresponding binary address some parts as an integer, number of signed/unsigned number, floating point Numbers, complex Numbers, letters, digits, Chinese/Korean/French... Character/string, assembly instructions, functions, function parameters, heap, stack, arrays, Pointers, array pointer and pointer array, the array of arrays, pointer to pointer, two-dimensional arrays, character lattice, the coordinates of character strokes, black and white binary images and grayscale images, color images, audio, video, fingerprint information, id information...

Recommended WinHex software to check the hard disk or file or original bytes of memory content,

CodePudding user response:

Can only say that 0 is an exception, all things, there is always an exception, the C language is not exceptional also, know to go, nothing to understand

CodePudding user response:

But it can also see that 0 do not represent the specific address, saying only that a null pointer,

CodePudding user response:

Can assign a constant, but the wrong kind, 0 is 0 (void *), or NULL

CodePudding user response:

1 D option pointer stored value not the address of the stored directly, you can understand it
Give you a popular example,
A cabinet, a moment is called the number one cabinet, can have 100 dollars in the cabinet is a pointer is the value of money,
You can take away or increase the money inside cabinet but you can't change the number of the cabinet,
You can give with cabinet and put 1000 dollars but you can't say to 1000 cabinet inside put money, because there is no such cabinet,


The second question, obviously,
I took the no. 1, 2, 3, changing his name to 0 cabinet cabinet,

CodePudding user response:

A typical hu Qin,
D unsuitable reason is not constant, but depends on type mismatch,
Actually, D may be used, depending on is in what circumstances, when need to use an absolute address, no way, the 1024 can also, it can be automatically converted to a pointer type,
  • Related