Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way for creating 2 dimensional arrays (matrix)

Status
Not open for further replies.

pipk

Programmer
Feb 20, 2001
455
GB
Hello, thanks for taking the time to read.

What is the best way for creating a 2 dimensional array.

i have a char set up using:-

unsigned char ** array;

and then allocated it using:-

array=new unsigned char*[x];
for(int j=0; j<x;j++)
*(array+j)=new unsigned char [y];

is there an easier way??

thanks in advance
 
haven't I already seen this once? There's no need to cross-post, most people answer questions in more than 1 foroum... As always, I hope that helped!

Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top