Jump to content

Recommended Posts

Posted

I have something like:

for(j=0; j<columnsNumber; j++) {
   for(i=0; i<rowsNumber; i++) {
    bufferMatix[j][i] = sourceMatrix[i][j];
   }


But it works only when rowsNumber=colsNumber

 

 

Thanks!

Posted

I think that will cause problems because you are copying things that were previously copied. You will need a temporary buffer.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

You still have a temporary variable, you're just using a lot of them in a function instead of one big buffer.

 

Just for fun, there IS a way to switch to variables without declaring a third.

 

int a = 3;

int b = 7;

a += b;

b = a - b;

a -= b;

 

I don't recommend doing that because you could create a number that exceeds the range of your data type.

  • Upvote 2

My job is to make tools you love, with the features you want, and performance you can't live without.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...