The postfix version of operator++() has a dummy parameter of type int. The prefix version
does not have dummy parameter.
a2a_linkname=”How are prefix and postfix versions of operator++() differentiated?char *const”;a2a_linkurl=”http://itquestions.info/how-are-prefix-and-postfix-versions-of-operator-differentiatedchar-const/”;
Const char *myPointer is a non constant pointer to constant data; while char *const
myPointer is a constant pointer to non constant data.
a2a_linkname=”What is the difference between const char *myPointer and char *const myPointer?”;a2a_linkurl=”http://itquestions.info/what-is-the-difference-between-const-char-mypointer-and-char-const-mypointer/”;
Throw an exception. Constructors don’t have a return type, so it’s not possible to use
return codes. The best way to signal constructor failure is therefore to throw an exception.
a2a_linkname=”How can I handle a constructor that fails?”;a2a_linkurl=”http://itquestions.info/how-can-i-handle-a-constructor-that-fails/”;
Write a message to a log-file. But do not throw an exception.
The C++ rule is that you must never throw an exception from a destructor that is being
called during the “stack unwinding” process of another exception. For example, if someone
says throw Foo(), the stack will be unwound so all the stack frames between the throw […]