What is uintptr_t and what it can be used for?
It is an unsigned int that is guaranteed to be the same size as a pointer. Its definition is not required by the standard.
A common reason to want an integer type that matches a pointer's size is to perform integer-specific operations on a pointer.
It's an unsigned integer type exactly the size of a pointer. Whenever you need to do something unusual with a pointer - like for example invert all bits (don't ask why) you cast it to uintptr_t and manipulate it as a usual integer number, then cast back.
First thing, uintptr_t is not in C++. It's in C99, in <stdint.h>, as an optional type. Many C++ compilers do provide that file. It will also be in C++0x, where again it will be optional (according to the draft I just looked at).
In C99, it is defined as "an unsigned integer type with the property that any valid pointer to void can be converted to this type, then converted back to pointer to void, and the result will compare equal to the original pointer".
Take this to mean what it says. It doesn't say anything about size.
uintptr_t might be the same size as a void*. It might be larger. It could conceivably be smaller, although such a C++ implementation approaches perverse. For example on some hypothetical platform where void* is 32 bits, but only 24 bits of virtual address space are used, you could have a 24-bit uintptr_t which satisfies the requirement. I don't know why an implementation would do that, but the standard permits it.