A
Asif
Hi there,
I have been trying to understand the behaviour of char (*pfn)(null)
for a couple of days. can some body help me understand the behaviour
of char (*pfn)(null) in Visual C++ environment?
The question is why this is legal
char *ptr;
char (*pfn)(null);
ptr = pfn
and this is not
char *ptr;
char (*fpn)();
ptr = *pfn // compile time error.
what actually is happening in the first case is that compiler treating
char (*pfn)(NULL) as char pointer. the question is why its not
generating the error for the first case too as both are two totally
different ideas.
Any response is highly appreciated.
Regards,
Asif
I have been trying to understand the behaviour of char (*pfn)(null)
for a couple of days. can some body help me understand the behaviour
of char (*pfn)(null) in Visual C++ environment?
The question is why this is legal
char *ptr;
char (*pfn)(null);
ptr = pfn
and this is not
char *ptr;
char (*fpn)();
ptr = *pfn // compile time error.
what actually is happening in the first case is that compiler treating
char (*pfn)(NULL) as char pointer. the question is why its not
generating the error for the first case too as both are two totally
different ideas.
Any response is highly appreciated.
Regards,
Asif