Click here to Skip to main content
15,922,696 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Method pointers and addresses Pin
Jörgen Sigvardsson26-Sep-03 7:08
Jörgen Sigvardsson26-Sep-03 7:08 
GeneralRe: Method pointers and addresses Pin
Michael Dunn26-Sep-03 9:12
sitebuilderMichael Dunn26-Sep-03 9:12 
GeneralRe: Method pointers and addresses Pin
Jörgen Sigvardsson26-Sep-03 7:15
Jörgen Sigvardsson26-Sep-03 7:15 
GeneralRe: Method pointers and addresses Pin
David Crow26-Sep-03 10:34
David Crow26-Sep-03 10:34 
GeneralRe: Method pointers and addresses Pin
Jörgen Sigvardsson26-Sep-03 10:37
Jörgen Sigvardsson26-Sep-03 10:37 
Generaloutput Pin
sardinka26-Sep-03 6:50
sardinka26-Sep-03 6:50 
GeneralRe: output Pin
David Crow26-Sep-03 6:52
David Crow26-Sep-03 6:52 
GeneralRe: output Pin
Navin26-Sep-03 6:57
Navin26-Sep-03 6:57 
IT depends - if you know they are the same length, and know what that length is, you can do this (using "cout" as an example, you can use print, or do it to a list box, or whatever.)

cout << "Array 1\t\tArray 2" << endl;
for(int i = 0; i < sizeOfArrays; i++)
{
  cout << array1[i] << "\t\t" << array2[i] << endl;
}


Now, if your array sizes are different, it's tricker. You either need array classes (e.g., CArray or stl::vector), or variables specifying the size of each array, and then in the for loop, check to make sure you're not out of bounds, e.g. (assuming array1 and array2 are STL vectors):

cout << "Array 1\t\tArray 2" << endl;
int arraySize = array1.size();
if(array2.size() > arraySize)
   arraySize = array2.size();
for(int i = 0; i < arraySize; i++)
{
   if(i < array1.size())
      cout << array1[i] << "\t\t";
   else
      cout << "(null)\t\t";
   if(i < array2.size())
      cout << array2[i] << endl;
   else
      cout << "(null)" << endl;
}


You can tweak the formatting as necessary.


If your nose runs and your feet smell, then you're built upside down.
GeneralRe: output Pin
sardinka26-Sep-03 9:25
sardinka26-Sep-03 9:25 
GeneralRe: output Pin
Ravi Bhavnani26-Sep-03 9:17
professionalRavi Bhavnani26-Sep-03 9:17 
GeneralOleLoadPicture() and Non-standard JPEG Files Pin
Steve Thresher26-Sep-03 5:45
Steve Thresher26-Sep-03 5:45 
GeneralSerializing question Pin
doctorpi26-Sep-03 4:46
doctorpi26-Sep-03 4:46 
GeneralRe: Serializing question Pin
David Crow26-Sep-03 5:44
David Crow26-Sep-03 5:44 
GeneralRe: Serializing question Pin
doctorpi26-Sep-03 6:20
doctorpi26-Sep-03 6:20 
GeneralRe: Serializing question Pin
David Crow26-Sep-03 6:50
David Crow26-Sep-03 6:50 
GeneralRe: Serializing question Pin
Nathan Smith26-Sep-03 5:57
Nathan Smith26-Sep-03 5:57 
GeneralRe: Serializing question Pin
Nathan Smith26-Sep-03 6:03
Nathan Smith26-Sep-03 6:03 
GeneralRe: Serializing question Pin
Navin26-Sep-03 6:51
Navin26-Sep-03 6:51 
GeneralRe: Serializing question Pin
Ravi Bhavnani26-Sep-03 8:40
professionalRavi Bhavnani26-Sep-03 8:40 
Generalusing a constant in several classes Pin
Jerome Conus26-Sep-03 4:39
Jerome Conus26-Sep-03 4:39 
GeneralRe: using a constant in several classes Pin
Dominik Reichl26-Sep-03 4:50
Dominik Reichl26-Sep-03 4:50 
GeneralRe: using a constant in several classes Pin
Alvaro Mendez26-Sep-03 5:06
Alvaro Mendez26-Sep-03 5:06 
GeneralRe: using a constant in several classes Pin
Joe Woodbury26-Sep-03 12:15
professionalJoe Woodbury26-Sep-03 12:15 
QuestionAccellerators in modeless dialog ? Pin
Brian van der Beek26-Sep-03 4:19
Brian van der Beek26-Sep-03 4:19 
AnswerRe: Accellerators in modeless dialog ? Pin
valikac26-Sep-03 4:32
valikac26-Sep-03 4:32 

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.