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

C / C++ / MFC

 
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 
GeneralRe: Exporting Classes Pin
Tom Archer4-May-02 13:58
Tom Archer4-May-02 13:58 
GeneralOverrides using Properties window in VC++ .NET Pin
4-May-02 9:31
suss4-May-02 9:31 
QuestionWhere should I post my TurboC++ / ASM / BIOS question? Pin
Maxwell Chen4-May-02 8:38
Maxwell Chen4-May-02 8:38 
GeneralArray of pointers Pin
Rohde4-May-02 8:16
Rohde4-May-02 8:16 
GeneralRe: Array of pointers Pin
Nish Nishant4-May-02 8:29
sitebuilderNish Nishant4-May-02 8:29 
GeneralRe: Array of pointers Pin
Paul M Watt4-May-02 9:22
mentorPaul M Watt4-May-02 9:22 
You were close:
int **array = new int*[SIZE];


That will allocate an array of integer pointers that has SIZE number of elements.

Just for everyone's knowledge, to access the pointers in this new array, you will need to do something like this:

int a = 10;
int b = 20;
int c = 30;
// you can point to existing integer buffers
array[0] = &a;
array[1] = &b;

// you can allocate new integers
array[2] = new int;
*array[2] = 50;

// you can allocate an array if integers to be held in this new pointer.
array[3] = new int[10];
array[3][0] = 100;


just remember to delete any memory that you allocate, even in the pointers inside of your allocated array.

Good Luck!


Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

GeneralRe: Array of pointers Pin
Maxwell Chen4-May-02 9:33
Maxwell Chen4-May-02 9:33 
GeneralRe: Array of pointers Pin
Christian Graus4-May-02 11:34
protectorChristian Graus4-May-02 11:34 
GeneralRe: Array of pointers Pin
Maxwell Chen4-May-02 20:57
Maxwell Chen4-May-02 20:57 
GeneralSetting Up Option Parameters :: C++ Pin
valikac4-May-02 7:19
valikac4-May-02 7:19 
GeneralRe: Setting Up Option Parameters :: C++ Pin
Ravi Bhavnani4-May-02 7:27
professionalRavi Bhavnani4-May-02 7:27 
GeneralRe: Setting Up Option Parameters :: C++ Pin
Maxwell Chen4-May-02 8:14
Maxwell Chen4-May-02 8:14 
GeneralRe: Setting Up Option Parameters :: C++ Pin
valikac4-May-02 8:22
valikac4-May-02 8:22 
GeneralClass scope.... Pin
Maxwell Chen4-May-02 8:28
Maxwell Chen4-May-02 8:28 
GeneralRe: Class scope.... Pin
Ravi Bhavnani4-May-02 9:30
professionalRavi Bhavnani4-May-02 9:30 
GeneralRe: Class scope.... Pin
Maxwell Chen4-May-02 9:37
Maxwell Chen4-May-02 9:37 
GeneralRe: Setting Up Option Parameters :: C++ Pin
Maxwell Chen4-May-02 8:19
Maxwell Chen4-May-02 8:19 
GeneralRe: Setting Up Option Parameters :: C++ Pin
valikac4-May-02 8:24
valikac4-May-02 8:24 
GeneralRe: Setting Up Option Parameters :: C++ Pin
PJ Arends4-May-02 8:31
professionalPJ Arends4-May-02 8:31 
GeneralRe: Setting Up Option Parameters :: C++ Pin
valikac4-May-02 8:43
valikac4-May-02 8:43 
GeneralRe: Setting Up Option Parameters :: C++ Pin
PJ Arends4-May-02 9:12
professionalPJ Arends4-May-02 9:12 
GeneralRe: Setting Up Option Parameters :: C++ Pin
Maxwell Chen4-May-02 9:28
Maxwell Chen4-May-02 9:28 
GeneralRe: Thanks Pin
valikac4-May-02 9:30
valikac4-May-02 9:30 

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.