|
-
April 7th, 2010, 09:42 AM
#2
Re: String problem
Your copy constructor is incorrect. Right now, once you use it you'll have two MyString objects pointing at the same physical character array in memory. One one them is destroyed, that array gets deleted......leaving the second one pointing to invalid memory.
Also, you need to define operator=.
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
|