classes and structs are the same, the only difference being that the default for a class is private and the default for a struct is public. people sometimes tend to use a struct when just storing data, but you might as well just use a class for whatever you need. in your case I'd have a class that stores the data in a 2 dimensional array, and have a few functions for adding or updating the values at any given coordinate:
Code:
// function prototype
void changeElement(int value, int col, int row);
// call to function
matrix.changeElement(2, 0, 0);
that would be a function to change the element at pos 0, 0 to the value 2. the way you wanted it. if you know how to write functions that should be easy to do. i'd also have a couple functions, one for returning the value in the element at any given coordinate:
Code:
// function prototype
int get(int col, int row);
// call to function
matrix.get(0, 0);
and there could be a function just to print out the whole matrix. if you needed it... i don't know about matrices 50x50 or bigger though. sounds like you just need to store data more than print it all out at once.
anyway read about classes, they're very helpful, you'll be allowed to make your own matrix class so that you just define a variable of the matrix type and use the built in functions to store and retrieve data. it's not hard
and yea, what madcow257 said about memory. if a 50x50 matrix of integers to you is huge, then don't worry about memory