Hi guys!
I'm pretty new to C++. I am currently on freshman year at college, and have a programming problem (not homework, it's actually a side project of mine) that consists on implementing some algebra-related functions on C++.
I'll go straight to the point:
int switchlines(int i, int j, int dim, int matrix[2][2]){
int aux;
for(int index = 0; index < dim; index++){
aux = matrix[i][index];
matrix[i][index] = matrix[j][index];
matrix[j][index] = aux;
}
return 1;
Now, as far as I know, when I pass an array to a function, I don't need to pass as reference, since it already does. Now, why the heck doesn't the matrix have its lines switched when I cout it later on the main?
Thanks a lot in advance =D
[PS: I've made the funcion an int so I can have return values, in case I need to debug something later on or so. If I finish the program and don't actually have a use for it, I'll just turn it into void...)