i am new to C programming .... so there are mere chances you will find the question damn easy
char *ii;
int i=54;
ii=(char *)&i;
for what purpose is there (char *) and is using char pointer for int address is helpful in some way ? and is it will be exactly the same as with using int pointer ?
This question seems to assume that using a char*
to hold the address of an integer has a valid purpose.
It does not, and is not a proper way to code.
There are cases where the data that a pointer points to is not known at compile time. And that can lead to code similar to this. But, as a general rule, it is not useful and should be avoided.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With