Pointer Conversions

From Appmethod Topics
Jump to: navigation, search

Go Up to Pointers Index

Pointer types can be converted to other pointer types using the typecasting mechanism:

char *str;
int *ip;
str = (char *)ip;

More generally, the cast (type*) will convert a pointer to type "pointer to type."

See C++ specific for a discussion of C++ typecast mechanisms.