Click here to Skip to main content
15,890,506 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Efficient way to read/write file Pin
Joe Woodbury8-Jun-20 23:25
professionalJoe Woodbury8-Jun-20 23:25 
GeneralRe: Efficient way to read/write file Pin
kalberts9-Jun-20 3:54
kalberts9-Jun-20 3:54 
GeneralRe: Efficient way to read/write file Pin
Joe Woodbury9-Jun-20 7:20
professionalJoe Woodbury9-Jun-20 7:20 
GeneralRe: Efficient way to read/write file Pin
charlieg11-Jun-20 11:53
charlieg11-Jun-20 11:53 
GeneralRe: Efficient way to read/write file Pin
kalberts11-Jun-20 19:39
kalberts11-Jun-20 19:39 
GeneralRe: Efficient way to read/write file Pin
charlieg12-Jun-20 8:30
charlieg12-Jun-20 8:30 
QuestionDoes WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
PrafullaVedante7-Jun-20 9:02
PrafullaVedante7-Jun-20 9:02 
AnswerRe: Does WaitForSingleObject timeout after 49 days if INFINITE is passed? Pin
Greg Utas7-Jun-20 11:00
professionalGreg Utas7-Jun-20 11:00 
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 

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.