Click here to Skip to main content
14,697,682 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Efficient way to read/write file Pin
Joe Woodbury9-Jun-20 0:25
professionalJoe Woodbury9-Jun-20 0:25 
GeneralRe: Efficient way to read/write file Pin
Member 79891229-Jun-20 4:54
MemberMember 79891229-Jun-20 4:54 
GeneralRe: Efficient way to read/write file Pin
Joe Woodbury9-Jun-20 8:20
professionalJoe Woodbury9-Jun-20 8:20 
GeneralRe: Efficient way to read/write file Pin
charlieg11-Jun-20 12:53
Membercharlieg11-Jun-20 12:53 
GeneralRe: Efficient way to read/write file Pin
Member 798912211-Jun-20 20:39
MemberMember 798912211-Jun-20 20:39 
GeneralRe: Efficient way to read/write file Pin
charlieg12-Jun-20 9:30
Membercharlieg12-Jun-20 9:30 
QuestionDoes WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
PrafullaVedante7-Jun-20 10:02
MemberPrafullaVedante7-Jun-20 10:02 
AnswerRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
Greg Utas7-Jun-20 12:00
professionalGreg Utas7-Jun-20 12:00 
AnswerRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
RedDk7-Jun-20 13:17
MemberRedDk7-Jun-20 13:17 
AnswerRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
CPallini7-Jun-20 21:40
mveCPallini7-Jun-20 21:40 
GeneralRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
PrafullaVedante8-Jun-20 1:09
MemberPrafullaVedante8-Jun-20 1:09 
GeneralRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
CPallini8-Jun-20 2:21
mveCPallini8-Jun-20 2:21 
GeneralRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
Joe Woodbury8-Jun-20 16:04
professionalJoe Woodbury8-Jun-20 16:04 
QuestionTranspose of a matrix Pin
Member 148492464-Jun-20 8:08
MemberMember 148492464-Jun-20 8:08 
AnswerRe: Transpose of a matrix Pin
Member 79891224-Jun-20 8:58
MemberMember 79891224-Jun-20 8:58 
AnswerRe: Transpose of a matrix Pin
CPallini4-Jun-20 21:25
mveCPallini4-Jun-20 21:25 
Of course the result must be the same. Try

#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 148492465-Jun-20 0:52
MemberMember 148492465-Jun-20 0:52 
GeneralRe: Transpose of a matrix Pin
CPallini5-Jun-20 1:04
mveCPallini5-Jun-20 1:04 
GeneralRe: Transpose of a matrix Pin
jeron15-Jun-20 5:53
Memberjeron15-Jun-20 5:53 
QuestionHow to draw a realtime XY plot in MFC Pin
manoharbalu1-Jun-20 23:31
Membermanoharbalu1-Jun-20 23:31 
AnswerRe: How to draw a realtime XY plot in MFC Pin
Victor Nijegorodov1-Jun-20 23:40
MemberVictor Nijegorodov1-Jun-20 23:40 
GeneralRe: How to draw a realtime XY plot in MFC Pin
Richard MacCutchan2-Jun-20 1:15
mveRichard MacCutchan2-Jun-20 1:15 
GeneralRe: How to draw a realtime XY plot in MFC Pin
Victor Nijegorodov2-Jun-20 1:24
MemberVictor Nijegorodov2-Jun-20 1:24 
AnswerRe: How to draw a realtime XY plot in MFC Pin
CPallini5-Jun-20 1:33
mveCPallini5-Jun-20 1:33 
AnswerRe: How to draw a realtime XY plot in MFC Pin
charlieg7-Jun-20 8:29
Membercharlieg7-Jun-20 8:29 

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.