954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help with Storing Arrays into a matrix C++

I'm trying to store these arrays into the matrix

double X[5][3]


so I could classify them with 1 Nearest Neighbour:

double brick_v[3]={ent_brick,en_brick,con_brick};
	double metal_v[3]={ent_metal,en_metal,con_metal};
	double skin_v[3]={ent_skin,en_skin,con_skin};
	double wood_v[3]={ent_wood,en_wood,con_wood};
	double grass_v[3]={ent_grass,en_grass,con_grass};


I would be very grateful if someone would show me how you can do this in C++.

bearlow
Newbie Poster
1 post since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

Not sure how you accept the input... Do you mean you currently have 5 variables which are arrays size of 3 and you want to instead use a 2D array? If so, you need to simply change the way you accept values and place each value into the new 2D array correctly.

Taywin
Posting Virtuoso
1,727 posts since Apr 2010
Reputation Points: 229
Solved Threads: 239
 

It's certainly possible to put data into multi-dimensional arrays, but there is not enough information here to get a good grasp of the problem you're trying to solve.

Where is the data coming from and how do you intend to use it?

Fbody
Posting Maven
2,930 posts since Oct 2009
Reputation Points: 833
Solved Threads: 393
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: