Click here to Skip to main content
16,016,425 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalhelp with radio buttons Pin
Michi7774-May-02 23:18
Michi7774-May-02 23:18 
GeneralRe: help with radio buttons Pin
Wolfram Steinke5-May-02 0:08
Wolfram Steinke5-May-02 0:08 
GeneralRe: help with radio buttons Pin
l a u r e n5-May-02 0:09
l a u r e n5-May-02 0:09 
GeneralRe: help with radio buttons Pin
Michael Dunn5-May-02 8:02
sitebuilderMichael Dunn5-May-02 8:02 
GeneralRe: help with radio buttons Pin
Michi7776-May-02 4:11
Michi7776-May-02 4:11 
GeneralHELP WITH ARRAYS Pin
dayknight4-May-02 16:01
dayknight4-May-02 16:01 
GeneralRe: HELP WITH ARRAYS Pin
4-May-02 16:14
suss4-May-02 16:14 
GeneralRe: HELP WITH ARRAYS Pin
Tom Archer4-May-02 16:59
Tom Archer4-May-02 16:59 
I made just a couple of very minor tweaks to your code to do what I think you're asking for. If this isn't what you want, then you'll need to be more specific as to the exact problem you're having.

Code


#include "iostream.h"

int data[5][5];
void loadArray() 
{ 
  int r, c, cnt=1; 

  for( r=0; r<5; r++ ) 
    for( c=0; c<5; c++ ) 
      data[r][c] = cnt++; 
} 

void displayArray( ) 
{ 
  int r, c; 

  cout << "The 5 x 5 2D array:\n\n"; 
  for (r=0;r<5;r++) 
  {
    for(c=0;c<5;c++) 
    {
      int value = data[r][c];
      cout << " " <<  ((10 > value) ? " " : "") << value;
    }
    cout << "\n";
  }
}

void _tmain(int argc, _TCHAR* argv[])
{
  loadArray();
  displayArray(); 
  int i; 
  cin >> i;
}


Output


The 5 x 5 2D array:

  1  2  3  4  5
  6  7  8  9 10
 11 12 13 14 15
 16 17 18 19 20
 21 22 23 24 25



Cheers,
Tom Archer
Author, Inside C#
Author, Visual C++.NET Bible

A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
GeneralRe: HELP WITH ARRAYS Pin
Maxwell Chen5-May-02 21:44
Maxwell Chen5-May-02 21:44 
GeneralRe: HELP WITH ARRAYS Pin
Tom Archer6-May-02 2:15
Tom Archer6-May-02 2:15 
GeneralGeting width of my CListbox Pin
4-May-02 12:40
suss4-May-02 12:40 
GeneralRe: Geting width of my CListbox Pin
Tom Archer4-May-02 13:23
Tom Archer4-May-02 13:23 
GeneralRe: Geting width of my CListbox Pin
Michael Dunn4-May-02 14:04
sitebuilderMichael Dunn4-May-02 14:04 
GeneralRe: Geting width of my CListbox - Thx Pin
4-May-02 14:45
suss4-May-02 14:45 
GeneralRe: Geting width of my CListbox - Thx Pin
Nish Nishant4-May-02 14:59
sitebuilderNish Nishant4-May-02 14:59 
GeneralRe: Geting width of my CListbox - Thx Pin
4-May-02 15:15
suss4-May-02 15:15 
GeneralRe: Geting width of my CListbox - Thx Pin
Tom Archer4-May-02 15:26
Tom Archer4-May-02 15:26 
GeneralRe: Geting width of my CListbox - Thx Pin
4-May-02 16:10
suss4-May-02 16:10 
GeneralSetting Permanent Margins CEditView :: MFC Pin
valikac4-May-02 12:31
valikac4-May-02 12:31 
GeneralAccesing other programs Pin
4-May-02 11:23
suss4-May-02 11:23 
GeneralRe: Accesing other programs Pin
Gabriel.P.G4-May-02 13:12
Gabriel.P.G4-May-02 13:12 
GeneralRe: Accesing other programs Pin
Nish Nishant4-May-02 14:58
sitebuilderNish Nishant4-May-02 14:58 
GeneralUnresolved External Symbol :( Pin
Derek Lakin4-May-02 11:11
Derek Lakin4-May-02 11:11 
GeneralExporting Classes Pin
Peter Liddle4-May-02 10:45
Peter Liddle4-May-02 10:45 
GeneralRe: Exporting Classes Pin
Paul M Watt4-May-02 12:17
mentorPaul M Watt4-May-02 12:17 

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.