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

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

Let's build cool stuff and have fun. :)

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...