What is Non-Portable Pointer Conversion ?

When a value is assigned to any pointer variable, then compiler will automatically try to convert  given value in pointer type, such automatic type conversion is known as Non-portable pointer conversion.

Non-portable pointer conversion is not cause of any compilation error but it is bad coding style. Hence compiler will generate a warning message.

Example :

Here, p=a assigns the value of a as the pointer variable instead of the value to be stored at address p and same with p=3223, it assigns 3223 as address of pointer type to p, instead of the value to be stored at p. So, a warning message is generated as


Leave a Reply

Your email address will not be published. Required fields are marked *