Click here to Skip to main content
15,917,455 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPGL Pin
Jonathan de Halleux9-Sep-02 1:57
Jonathan de Halleux9-Sep-02 1:57 
GeneralMULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONE Pin
emrosa4-Jul-02 2:31
emrosa4-Jul-02 2:31 
GeneralRe: MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONE Pin
Alan Chambers4-Jul-02 3:28
Alan Chambers4-Jul-02 3:28 
GeneralRe: MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONE Pin
emrosa4-Jul-02 4:18
emrosa4-Jul-02 4:18 
GeneralRe: MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONE Pin
Alan Chambers4-Jul-02 5:56
Alan Chambers4-Jul-02 5:56 
GeneralRe: MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONE Pin
4-Jul-02 11:25
suss4-Jul-02 11:25 
GeneralRe: MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONE Pin
Martin Ziacek4-Jul-02 3:43
Martin Ziacek4-Jul-02 3:43 
GeneralRe: MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONE Pin
emrosa4-Jul-02 4:20
emrosa4-Jul-02 4:20 
Thanks for your help....I have tried that and it did work...therefore, making a generalization for this, I just found this:

Let be a multidimensional array MArray[max1stdim][max2nddim]...[maxnthdim], the indexes referencing certain location be i1,i2,...,in.
If MArray is declared as
int MArray[max1stdim*max2nddim*...*maxnthdim];
then the index referencing the location (i1,i2,...in-1,in) will be:

index=(i1*max2nddim*max3rddim*...*maxnthdim)+(i2*max3rddim*...*maxnthdim)+...+(in-1)*maxnthdim+in

Then for an array MArray[4][3][2] declared as MArray[3*3*3], the single index to reference (i,j,k)will be:

index=(i*4*3)+(j*2)+k

I have tried this and it works!

Thanks again.....
Smile | :) Wink | ;)

Eric Manuel Rosales Pena Alfaro
PhD student
Unversity of Essex
Wivenhoe Park
Colchester, CO4 3SQ
Essex, Uk
email: emrosa@essex.ac.uk
tel: +44-01206-87311
GeneralRe: MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONE Pin
Martin Ziacek4-Jul-02 4:41
Martin Ziacek4-Jul-02 4:41 
GeneralRe: MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONE Pin
emrosa4-Jul-02 4:46
emrosa4-Jul-02 4:46 
GeneralRe: MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONE Pin
Martin Ziacek4-Jul-02 4:53
Martin Ziacek4-Jul-02 4:53 
GeneralLink before compile (?) in MSDev Pin
Cristian Amarie4-Jul-02 1:47
Cristian Amarie4-Jul-02 1:47 
GeneralRe: Link before compile (?) in MSDev Pin
Jeremy Pullicino4-Jul-02 1:50
Jeremy Pullicino4-Jul-02 1:50 
GeneralRe: Link before compile (?) in MSDev Pin
Tibor Blazko4-Jul-02 1:51
Tibor Blazko4-Jul-02 1:51 
GeneralRe: Link before compile (?) in MSDev Pin
Tibor Blazko4-Jul-02 3:56
Tibor Blazko4-Jul-02 3:56 
GeneralRe: Link before compile (?) in MSDev Pin
Martin Ziacek4-Jul-02 4:22
Martin Ziacek4-Jul-02 4:22 
QuestionActiveX events from automation server (.EXE) ? Pin
4-Jul-02 1:36
suss4-Jul-02 1:36 
AnswerRe: ActiveX events from automation server (.EXE) ? Pin
MrBean4-Jul-02 22:21
MrBean4-Jul-02 22:21 
GeneralRe: ActiveX events from automation server (.EXE) ? Pin
MrBean7-Jul-02 22:00
MrBean7-Jul-02 22:00 
GeneralQuestion about Spy++ Pin
User 66584-Jul-02 1:19
User 66584-Jul-02 1:19 
GeneralRe: Question about Spy++ Pin
Nish Nishant4-Jul-02 1:49
sitebuilderNish Nishant4-Jul-02 1:49 
GeneralRe: Question about Spy++ Pin
User 66584-Jul-02 8:16
User 66584-Jul-02 8:16 
General#pragma once and #ifndef Pin
-Dy4-Jul-02 0:35
-Dy4-Jul-02 0:35 
GeneralRe: #pragma once and #ifndef Pin
Alan Chambers4-Jul-02 1:16
Alan Chambers4-Jul-02 1:16 
GeneralRe: #pragma once and #ifndef Pin
Alexandru Savescu4-Jul-02 8:51
Alexandru Savescu4-Jul-02 8:51 

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.