|
-
October 22nd, 2005, 07:09 AM
#5
Re: conceptual problem
An addition to the list Paul mentioned.
 Originally Posted by psullsack
const char *s = NULL;
There can be no use of 's' now. It cannot be changed and if you however attempt changing it using const_cast it would result in an undefined behaviour. What is the use of it? You already have the NULL macro pre-defined. Any further usage of the variable 's' in your code is not correct. I also suggest you to use std::string. Please use it. You can learn about it from here:
C++ string
Hope this helps. Regards.
Last edited by exterminator; October 22nd, 2005 at 07:19 AM.
Reason: added the link
Can you help me with my homework assignment?, Before you post!, Use code tags, How to post!, Codeguru technical FAQs, C++ FAQ Lite, Stroustrup: C++ Style and Technique FAQ, Guru of the Week, Comeau C and C++ FAQs, Comeau C++ Templates FAQs, CUJ @ DDJ, Spam threshold
My Blogs : Learning C++ is fun | Abnegator's reflections
Open Threads : C++ Aha! Moments | Nature of work in C++?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|