I have an array of ints:
int a[1];
I then want to make the items in a be pointers to the next dimension of arrays.
a[0] = new int b[3];
Would I then be able to use the double bracket indexing?
a[0][0] = 1; //Assign 1 to b[0]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to make items in
aarray, then you have to define it that way.Or similary
Or
But as you you have
c++tag, you should rather usestd::vector(orstd::arrayinc++11).