0

I have a vector which i wish to fill with char's, so that each char is then a pointer to a vector.

vector<char> list;

list[0] = 'A';
list[1] = 'B';

How do I make 'A' and 'B' pointers to other vectors?

void Create_Pointers(char pointer_name)
{
	pointer_name = new vector<char *>;
	list.push_back(pointer_name);
	
}

would pointer_name have to be declared as a pointer?

5
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by daviddoria
0

In that sample code, pointer_name should really be vector_name, no? And pointer_name should be of type std::vector<std::vector<<char *> >, no? And what is 'list'?

void Create_Pointers(std::vector<std::vector<char *> > pointer_name)
{
	std::vector<char *> NewVector;
	pointer_name.push_back(NewVector);
	
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.