Click here to Skip to main content
15,881,678 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
RedDk7-Jun-20 12:17
RedDk7-Jun-20 12:17 
AnswerRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
CPallini7-Jun-20 20:40
mveCPallini7-Jun-20 20:40 
GeneralRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
PrafullaVedante8-Jun-20 0:09
PrafullaVedante8-Jun-20 0:09 
GeneralRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
CPallini8-Jun-20 1:21
mveCPallini8-Jun-20 1:21 
GeneralRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
Joe Woodbury8-Jun-20 15:04
professionalJoe Woodbury8-Jun-20 15:04 
QuestionTranspose of a matrix Pin
Member 148492464-Jun-20 7:08
Member 148492464-Jun-20 7:08 
AnswerRe: Transpose of a matrix Pin
kalberts4-Jun-20 7:58
kalberts4-Jun-20 7:58 
AnswerRe: Transpose of a matrix Pin
CPallini4-Jun-20 20:25
mveCPallini4-Jun-20 20:25 
Of course the result must be the same. Try

C++
#include <iostream>
using namespace std;


void transp_v1( char tgt[3][3], char src[3][3] );
void transp_v2( char tgt[3][3], char src[3][3] );
void dump( char m[3][3] );


int main()
{
  char a[3][3] =
  {
    { 'a', 'b', 'c' },
    { 'd', 'e', 'f' },
    { 'g', 'h', 'i' },
  };

  char b[3][3];
  char c[3][3];

  transp_v1( b, a);
  transp_v2( c, a);


  dump(a);
  cout << "--------\n";
  dump(b);
  cout << "--------\n";
  dump(c);
  cout << "--------\n";
}
void transp_v1( char tgt[3][3], char src[3][3] )
{
  for (int i=0; i<3; ++i)
    for (int j=0; j<3; ++j)
      tgt[i][j] = src[j][i];
}

void transp_v2( char tgt[3][3], char src[3][3] )
{
  for (int i=0; i<3; ++i)
    for (int j=0; j<3; ++j)
      tgt[j][i] = src[i][j];
}

void dump( char m[3][3] )
{
  for (int i=0; i<3; ++i)
  {
    for (int j=0; j<3; ++j)
      cout << m[i][j] << " ";
    cout << "\n";
  }
}


output:
a b c 
d e f 
g h i 
--------
a d g 
b e h 
c f i 
--------
a d g 
b e h 
c f i 
--------

GeneralRe: Transpose of a matrix Pin
Member 148492464-Jun-20 23:52
Member 148492464-Jun-20 23:52 
GeneralRe: Transpose of a matrix Pin
CPallini5-Jun-20 0:04
mveCPallini5-Jun-20 0:04 
GeneralRe: Transpose of a matrix Pin
jeron15-Jun-20 4:53
jeron15-Jun-20 4:53 
QuestionHow to draw a realtime XY plot in MFC Pin
manoharbalu1-Jun-20 22:31
manoharbalu1-Jun-20 22:31 
AnswerRe: How to draw a realtime XY plot in MFC Pin
Victor Nijegorodov1-Jun-20 22:40
Victor Nijegorodov1-Jun-20 22:40 
GeneralRe: How to draw a realtime XY plot in MFC Pin
Richard MacCutchan2-Jun-20 0:15
mveRichard MacCutchan2-Jun-20 0:15 
GeneralRe: How to draw a realtime XY plot in MFC Pin
Victor Nijegorodov2-Jun-20 0:24
Victor Nijegorodov2-Jun-20 0:24 
AnswerRe: How to draw a realtime XY plot in MFC Pin
CPallini5-Jun-20 0:33
mveCPallini5-Jun-20 0:33 
AnswerRe: How to draw a realtime XY plot in MFC Pin
charlieg7-Jun-20 7:29
charlieg7-Jun-20 7:29 
QuestionRandom numbers Pin
Calin Negru1-Jun-20 21:03
Calin Negru1-Jun-20 21:03 
AnswerRe: Random numbers Pin
_Flaviu1-Jun-20 21:26
_Flaviu1-Jun-20 21:26 
GeneralRe: Random numbers Pin
Calin Negru2-Jun-20 5:34
Calin Negru2-Jun-20 5:34 
GeneralRe: Random numbers Pin
Joe Woodbury2-Jun-20 11:21
professionalJoe Woodbury2-Jun-20 11:21 
AnswerRe: Random numbers Pin
Richard MacCutchan1-Jun-20 22:25
mveRichard MacCutchan1-Jun-20 22:25 
GeneralRe: Random numbers Pin
Calin Negru2-Jun-20 4:10
Calin Negru2-Jun-20 4:10 
GeneralRe: Random numbers Pin
Richard MacCutchan2-Jun-20 5:22
mveRichard MacCutchan2-Jun-20 5:22 
GeneralRe: Random numbers Pin
Calin Negru2-Jun-20 6:52
Calin Negru2-Jun-20 6:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.