Pointer Dereference in C and C++
Before you will understand take a quick overview of "What is Pointer" because I have some reference from my that article.
Now coming to the current article,
The
"dereference" operation follows a pointer's reference to get the value
of its pointee. The value of the dereference of numPtr above is 42(diagram is in the above "What is Pointer" article). When
the dereference operation is used correctly, it's simple. It just
accesses the value of the pointee. The only restriction is that the
pointer must have a pointee for the dereference to access. Almost all
bugs in pointer code involve violating that one restriction. A pointer
must be assigned a pointee before dereference operations will work.
See Also:
No comments:
Post a Comment