Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I've been trying to make a vector of arrays in c++:
vector<char[16]>
but, apparently, that doesn't work. So, I've been trying to figure out how to make
vector<vector<char> >
but I need the char vectors to be 16 long. I can't have them initialized to 0 length because I need random access to them.
If I have
vector<vector<char> > data
I need to be able to do data[i][n] = something. However, if data[i] is 0 length, which it will be when it's initialized, I won't be able to.

Why dont u use a vector of strings? As far as I know a string is basically a vector of chars anyway.
#include <string.h>
#include <vector.h> //whatever the header file is
int main()
{
vector<string>
...
}I dont know if this'll work, just a thought.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |