Read this great article Stop checking for NULL pointers! It mentions that there are many other invalid pointers than NULL, which is the same idea I had recently with regard to foreign keys in databases.
Tag Archives: pointer
Differences between C++ pointers and C++ references
41
I was curious about the difference between C++ pointers and C++ references, so I searched and found this which says that basically:
- It’s not necessary to initialise pointers at declaration time, but it is necessary to initialise references at declaration time.
- You can create an array of pointers, but you can’t create an array of references.
- You can assign null to pointers, but you can’t assign null to references.