Click here to Skip to main content
15,889,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionClassic question: dynamic 2D arrays in standard C Pin
bouli25-Feb-06 2:41
bouli25-Feb-06 2:41 
AnswerRe: Classic question: dynamic 2D arrays in standard C Pin
Stephen Hewitt25-Feb-06 2:45
Stephen Hewitt25-Feb-06 2:45 
GeneralRe: Classic question: dynamic 2D arrays in standard C Pin
bouli25-Feb-06 2:54
bouli25-Feb-06 2:54 
Hi steve,
Thanks for your reply.
Actually I am targetting the algorithm with the loops and use it as a normal array.
<br />
int** myArray=NULL;<br />
<br />
int** AllocateArray(int nHeight, int nWidth)<br />
{<br />
int** newArray=NULL;<br />
int i, j;<br />
<br />
for (i=0; i < nHeight; i++)<br />
.... // I don't remember<br />
<br />
return newArray;<br />
}<br />
<br />
void FreeArray(int*** array)<br />
{<br />
// free the array...<br />
}<br />
<br />
// usage<br />
int** myArray=AllocateArray(32, 32);<br />
<br />
// access<br />
myArray[i][j]<br />
<br />
// delete<br />
FreeArray(&myArray);<br />

I don't remember the rest of the code.... that's the purpose of this topic Wink | ;)

Thanks for helping me.

Fred.



There is no spoon.

-- modified at 8:55 Saturday 25th February, 2006
GeneralRe: Classic question: dynamic 2D arrays in standard C Pin
bouli25-Feb-06 5:06
bouli25-Feb-06 5:06 
AnswerRe: Classic question: dynamic 2D arrays in standard C Pin
David Crow25-Feb-06 3:58
David Crow25-Feb-06 3:58 
GeneralRe: Classic question: dynamic 2D arrays in standard C Pin
bouli25-Feb-06 5:06
bouli25-Feb-06 5:06 
Questiona question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 0:16
Hamed Musavi25-Feb-06 0:16 
AnswerRe: a question that did not get any true answer :(( Pin
Stephen Hewitt25-Feb-06 0:29
Stephen Hewitt25-Feb-06 0:29 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 0:42
Hamed Musavi25-Feb-06 0:42 
GeneralRe: a question that did not get any true answer :(( Pin
Stephen Hewitt25-Feb-06 0:56
Stephen Hewitt25-Feb-06 0:56 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 1:07
Hamed Musavi25-Feb-06 1:07 
GeneralRe: a question that did not get any true answer :(( Pin
Stephen Hewitt25-Feb-06 1:19
Stephen Hewitt25-Feb-06 1:19 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 1:29
Hamed Musavi25-Feb-06 1:29 
GeneralRe: a question that did not get any true answer :(( Pin
Stephen Hewitt25-Feb-06 2:37
Stephen Hewitt25-Feb-06 2:37 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 20:15
Hamed Musavi25-Feb-06 20:15 
QuestionRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 1:09
Hamed Musavi25-Feb-06 1:09 
AnswerRe: a question that did not get any true answer :(( Pin
Stephen Hewitt25-Feb-06 1:12
Stephen Hewitt25-Feb-06 1:12 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 1:20
Hamed Musavi25-Feb-06 1:20 
GeneralRe: a question that did not get any true answer :(( Pin
toxcct25-Feb-06 9:00
toxcct25-Feb-06 9:00 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi25-Feb-06 20:24
Hamed Musavi25-Feb-06 20:24 
GeneralRe: a question that did not get any true answer :(( Pin
BadKarma25-Feb-06 23:11
BadKarma25-Feb-06 23:11 
GeneralRe: a question that did not get any true answer :(( Pin
Hamed Musavi26-Feb-06 2:38
Hamed Musavi26-Feb-06 2:38 
NewsI thought about a soloution. Pin
Hamed Musavi25-Feb-06 1:44
Hamed Musavi25-Feb-06 1:44 
QuestionColor picker extension Pin
Hans Dietrich25-Feb-06 0:05
mentorHans Dietrich25-Feb-06 0:05 
AnswerRe: Color picker extension Pin
Blake Miller27-Feb-06 6:05
Blake Miller27-Feb-06 6:05 

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.