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

C / C++ / MFC

 
AnswerRe: CArray GROWING........ Pin
John R. Shaw12-Feb-06 4:46
John R. Shaw12-Feb-06 4:46 
QuestionAnother question about binary files... Pin
Lord Kixdemp11-Feb-06 10:55
Lord Kixdemp11-Feb-06 10:55 
AnswerRe: Another question about binary files... Pin
John R. Shaw12-Feb-06 5:19
John R. Shaw12-Feb-06 5:19 
GeneralRe: Another question about binary files... Pin
Lord Kixdemp12-Feb-06 6:52
Lord Kixdemp12-Feb-06 6:52 
GeneralRe: Another question about binary files... Pin
John R. Shaw12-Feb-06 7:20
John R. Shaw12-Feb-06 7:20 
GeneralRe: Another question about binary files... Pin
Lord Kixdemp12-Feb-06 7:28
Lord Kixdemp12-Feb-06 7:28 
QuestionCArray - How to implement Multidimensional arrays? Pin
RockyJames11-Feb-06 8:04
RockyJames11-Feb-06 8:04 
AnswerRe: CArray - How to implement Multidimensional arrays? Pin
Kevin McFarlane11-Feb-06 8:39
Kevin McFarlane11-Feb-06 8:39 
// ***************************************
// Example: Dynamic Multidimensional Array
// ***************************************

// We want both array dimensions to be allocated dynamically and
// to be able to reference an element as x[i][j]
// Here's how to do it...

// ***********
// MFC Version
// ***********

// Array of ints
typedef CArray <int, int> CIntArray;

// Array of arrays of ints
typedef CArray <CIntArray, CIntArray&> CMultiIntArray;

void TraceDynamicArray(const unsigned int rows, const unsigned int columns)
{
  CMultiIntArray aTest;
  

 // Allocate number of rows
  aTest.SetSize( rows );
  

 // For each row
  for (int row = 0; row < aTest.GetSize(); row++)
  {
    // Allocate number of columns
    aTest[row].SetSize( columns );
    

   // For each column
    for (int column = 0; column < aTest[row].GetSize(); column++)
    {
      // Assign a value
      aTest [row] [column] = 10 * row + column;
      

     // Trace it
      afxDump << aTest [row] [column] << "\t";
    }

   afxDump << "\n";
  }
}


Kevin
GeneralRe: CArray - How to implement Multidimensional arrays? Pin
RockyJames11-Feb-06 8:50
RockyJames11-Feb-06 8:50 
AnswerRe: CArray - How to implement Multidimensional arrays? Pin
Gary R. Wheeler12-Feb-06 4:49
Gary R. Wheeler12-Feb-06 4:49 
QuestionHow to get a VC++.Net (2003) AddIn working? Pin
Axter11-Feb-06 6:51
professionalAxter11-Feb-06 6:51 
QuestionWriting std::string to a binary file? Pin
Lord Kixdemp11-Feb-06 6:43
Lord Kixdemp11-Feb-06 6:43 
AnswerRe: Writing std::string to a binary file? Pin
Ravi Bhavnani11-Feb-06 6:59
professionalRavi Bhavnani11-Feb-06 6:59 
GeneralRe: Writing std::string to a binary file? Pin
Lord Kixdemp11-Feb-06 7:27
Lord Kixdemp11-Feb-06 7:27 
GeneralRe: Writing std::string to a binary file? Pin
Ravi Bhavnani11-Feb-06 7:33
professionalRavi Bhavnani11-Feb-06 7:33 
GeneralRe: Writing std::string to a binary file? Pin
Lord Kixdemp11-Feb-06 8:08
Lord Kixdemp11-Feb-06 8:08 
GeneralRe: Writing std::string to a binary file? Pin
Ravi Bhavnani11-Feb-06 8:11
professionalRavi Bhavnani11-Feb-06 8:11 
QuestionDetecting Internet connection Pin
Healdp11-Feb-06 0:53
Healdp11-Feb-06 0:53 
AnswerRe: Detecting Internet connection Pin
Taka Muraoka11-Feb-06 2:07
Taka Muraoka11-Feb-06 2:07 
AnswerRe: Detecting Internet connection Pin
bob1697211-Feb-06 2:49
bob1697211-Feb-06 2:49 
GeneralRe: Detecting Internet connection Pin
Healdp11-Feb-06 4:04
Healdp11-Feb-06 4:04 
GeneralRe: Detecting Internet connection Pin
bob1697211-Feb-06 5:05
bob1697211-Feb-06 5:05 
GeneralRe: Detecting Internet connection Pin
Healdp12-Feb-06 1:22
Healdp12-Feb-06 1:22 
GeneralRe: Detecting Internet connection Pin
bob1697211-Feb-06 5:26
bob1697211-Feb-06 5:26 
GeneralRe: Detecting Internet connection Pin
Healdp11-Feb-06 5:45
Healdp11-Feb-06 5:45 

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.