accelerated c++ 10.4

Aug 25, 2017 at 1:55pm
I need help with this exercise, what am I supposed to do? Write a class that implements a list that holds strings.

Is it just a class it's private attribute is a list<string>?

This is what I started:

1
2
3
4
5
6
7
8
9
10
#include <list>
#include <string>

class stringList {
private:
	std::list<std::string> stringList;
public:
	stringList();
	void addString(std::string);
};


I don't know if that's what the exercise is asking...
Aug 25, 2017 at 2:16pm
It sounds more like they want you to implement a list yourself, not just using std::list. It's not clear from the question alone if they want you to implement a linked list, or some kind of array/vector data structure but maybe you can guess based on what the chapter is about and what you have learned so far.
Last edited on Aug 25, 2017 at 2:19pm
Aug 25, 2017 at 2:18pm
The chapter is about arrays and pointers, so I guess it must be an array of strings
Topic archived. No new replies allowed.