Const (computer programming): Difference between revisions

Content deleted Content added
m History: archive link repair, may include: archive.* -> archive.today, and http->https for ghostarchive.org and archive.org (wp:el#Specifying_protocols)
Removes the stupid Pointee thing with "pointed to" that reads much better.
Line 41:
int const * const constPtrToConst )
{
*ptr = 0; // OK: modifies the "pointee"pointed to data
ptr = NULL; // OK: modifies the pointer
 
*ptrToConst = 0; // Error! Cannot modify the "pointee"pointed to data
ptrToConst = NULL; // OK: modifies the pointer
 
Line 50:
constPtr = NULL; // Error! Cannot modify the pointer
 
*constPtrToConst = 0; // Error! Cannot modify the "pointee"pointed to data
constPtrToConst = NULL; // Error! Cannot modify the pointer
}