| | |
vector pointers
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2008
Posts: 92
Reputation:
Solved Threads: 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?
would pointer_name have to be declared as a pointer?
vector<char> list;
list[0] = 'A';
list[1] = 'B';
How do I make 'A' and 'B' pointers to other vectors?
C++ Syntax (Toggle Plain Text)
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?
Also, you could use boost or ptr_vector.
Always code as if your client were a maniac seriall killer who knows where you live.
•
•
Join Date: Feb 2008
Posts: 638
Reputation:
Solved Threads: 46
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'?
C++ Syntax (Toggle Plain Text)
void Create_Pointers(std::vector<std::vector<char *> > pointer_name) { std::vector<char *> NewVector; pointer_name.push_back(NewVector); }
![]() |
Similar Threads
- Pass a vector of "real objects" from a vector of pointers? (C++)
- retuning a const refrence to a vector of pointers (C++)
- Vector of pointers to member functions in a class (C++)
- How to initialize a vector of pointers? (C++)
- Trouble with vector of pointers (C++)
Other Threads in the C++ Forum
- Previous Thread: HTTP Request in C++ & wt web toolkit
- Next Thread: Copying Files With C++
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






