|
-
April 8th, 2009, 05:25 AM
#14
Re: How to ctreate an array of objects that contain character strings
 Originally Posted by leonida
but my confusion is how to create an array of objects, a data member should be a pointer to null-terminated string
As demonstrated, use a std::vector<std::string>. You would access it just as you would a "normal" array.
If due to assignment requirements you are not allowed to do so, then...
 Originally Posted by leonida
I do know how to declare an object whose data member is a pointer to string, but I really don't know how to implement that into arrays and then retrieve data from an array.
Let's see your current code. Chances are, you should be creating your own string class.
Tags for this Thread
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
|