Edited my post.
Edited my post.
Looks correct. I suggest that you declare str to be a const char* for const-correctness.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Isn't the super const-correct form :
?Code:const char* const
That second const makes no difference to the caller and is effectively implementation detail.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)