Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Simple Pointer Problem in C Language
Simple Pointer Problem in C Language
int * p; A pointer variable p pointing to an integer is defined.

p = 1000; The formula has pointer type on the left and int type on the right, so it cannot be assigned successfully. Although P as a pointer refers to the physical address unit in memory, and it is also an integer serial number, when we write 1000, the compiler will default to int type and will not assign 1000 as the memory unit address to P.

Forced type conversion should be (int *)1000;

I wonder if it will help you. Hmm. How interesting

Hope to adopt