Click here to Skip to main content
16,012,082 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DDK Problems Pin
Beer2626-Jul-03 8:37
Beer2626-Jul-03 8:37 
GeneralNeed help in writing files (log style most likely) Pin
Snyp25-Jul-03 11:02
Snyp25-Jul-03 11:02 
GeneralRe: Need help in writing files (log style most likely) Pin
Chris Maunder25-Jul-03 15:01
cofounderChris Maunder25-Jul-03 15:01 
GeneralRe: Need help in writing files (log style most likely) Pin
Snyp26-Jul-03 3:05
Snyp26-Jul-03 3:05 
Generaldeclaring 2 D array Pin
Anonymous25-Jul-03 8:22
Anonymous25-Jul-03 8:22 
GeneralRe: declaring 2 D array Pin
AlexO25-Jul-03 9:16
AlexO25-Jul-03 9:16 
GeneralRe: declaring 2 D array Pin
David Crow25-Jul-03 10:53
David Crow25-Jul-03 10:53 
GeneralRe: declaring 2 D array Pin
Bob Stanneveld25-Jul-03 10:17
Bob Stanneveld25-Jul-03 10:17 
you can use pointers and memmory allocation to do the trick! try this, it should work, I had an assignment on this, a while ago... Let's see if I can dig up some code Smile | :)

__int8 *stepArray[4] = NULL; // declaration

// n should be the number of rows you want, not the highest index!!!
// the best way to insert elements is through a function or to embed this 
// array in a class
stepArray = (__int8 **) malloc(n * sizeof(__int8*)); // the number of rows you want
// allocate for each row 4 columns
while(n-- > 0)
    stepArray[n] = (__int8*) malloc(sizeof(__int8));


after this, you can use it as a normal 2d matrix (stepArray[n][m] =...)

It is far more easy to use a vector of some sort, but it's more fun to do it yourself (at least, I experience it that way Smile | :) )

hope this helps Smile | :)

ps.
I don't want te scare you, but beware of memory leaks, because they sneak in very easy...




A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.



GeneralHaving trouble using Chris' Grid Control Pin
Terry O'Nolley25-Jul-03 8:21
Terry O'Nolley25-Jul-03 8:21 
GeneralRe: Having trouble using Chris' Grid Control Pin
John M. Drescher25-Jul-03 8:33
John M. Drescher25-Jul-03 8:33 
GeneralRe: Having trouble using Chris' Grid Control Pin
Terry O'Nolley25-Jul-03 9:29
Terry O'Nolley25-Jul-03 9:29 
GeneralRe: Having trouble using Chris' Grid Control Pin
John M. Drescher25-Jul-03 9:51
John M. Drescher25-Jul-03 9:51 
GeneralRe: Having trouble using Chris' Grid Control Pin
Terry O'Nolley25-Jul-03 12:18
Terry O'Nolley25-Jul-03 12:18 
GeneralRe: Having trouble using Chris' Grid Control Pin
John M. Drescher25-Jul-03 12:36
John M. Drescher25-Jul-03 12:36 
GeneralRe: Having trouble using Chris' Grid Control Pin
Terry O'Nolley25-Jul-03 12:54
Terry O'Nolley25-Jul-03 12:54 
GeneralRe: Having trouble using Chris' Grid Control Pin
John M. Drescher25-Jul-03 12:57
John M. Drescher25-Jul-03 12:57 
GeneralRe: Having trouble using Chris' Grid Control Pin
Terry O'Nolley25-Jul-03 13:08
Terry O'Nolley25-Jul-03 13:08 
GeneralRe: Having trouble using Chris' Grid Control Pin
John M. Drescher25-Jul-03 13:11
John M. Drescher25-Jul-03 13:11 
GeneralRe: Having trouble using Chris' Grid Control Pin
John M. Drescher25-Jul-03 13:14
John M. Drescher25-Jul-03 13:14 
GeneralRe: Having trouble using Chris' Grid Control Pin
John M. Drescher25-Jul-03 13:19
John M. Drescher25-Jul-03 13:19 
GeneralRe: Having trouble using Chris' Grid Control Pin
Terry O'Nolley25-Jul-03 14:15
Terry O'Nolley25-Jul-03 14:15 
GeneralRe: Having trouble using Chris' Grid Control Pin
Terry O'Nolley25-Jul-03 14:21
Terry O'Nolley25-Jul-03 14:21 
GeneralRe: Having trouble using Chris' Grid Control Pin
Terry O'Nolley25-Jul-03 15:00
Terry O'Nolley25-Jul-03 15:00 
GeneralRe: Having trouble using Chris' Grid Control Pin
Chris Maunder25-Jul-03 15:10
cofounderChris Maunder25-Jul-03 15:10 
GeneralRe: Having trouble using Chris' Grid Control Pin
Chris Maunder25-Jul-03 15:03
cofounderChris Maunder25-Jul-03 15:03 

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.