member function advice needed

im making an iterative program that uses an algorithm to update the elements of a matrix. I made the program in procedural/functional form before, but now i am learning classes and re-doing the whole thing. Here is the crux of my problem.

int Cmatrix::update(){

for(int x=0;x<=(vector_width-1);x++){
for(int y=0;y<=(vector_height-1);y++){

if (F[x][y]== 0){F[x][y]=1;}
else F[x][y]=do_something();
}
}
}

this is not the algorithm just an example, in the real algorithm there would be many if's, do_something()'s, etc. I do intend the algorithm to stay inside this member.

previously do_something() would return a value to change F[x][y] for a standard functional program, but this is no longer possible within the member function(even if i can i dont want to). I am not sure what my options are, so if anyone could point me in the right direction i would appreciate it.
A member functions don't differ from any other functions, except that you can access the member variables of that particular class
Topic archived. No new replies allowed.