Click here to Skip to main content
15,915,513 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMaximum ARRAY SIZE? Pin
zaferaslan10-May-04 0:03
zaferaslan10-May-04 0:03 
AnswerRe: Maximum ARRAY SIZE? Pin
Jens Doose10-May-04 0:13
Jens Doose10-May-04 0:13 
GeneralRe: Maximum ARRAY SIZE? Pin
zaferaslan10-May-04 0:21
zaferaslan10-May-04 0:21 
GeneralRe: Maximum ARRAY SIZE? Pin
Jens Doose10-May-04 0:31
Jens Doose10-May-04 0:31 
GeneralRe: Maximum ARRAY SIZE? Pin
zaferaslan10-May-04 0:41
zaferaslan10-May-04 0:41 
AnswerRe: Maximum ARRAY SIZE? Pin
David Crow10-May-04 2:49
David Crow10-May-04 2:49 
GeneralRe:David - Maximum ARRAY SIZE? Pin
zaferaslan10-May-04 3:14
zaferaslan10-May-04 3:14 
GeneralRe:David - Maximum ARRAY SIZE? Pin
David Crow10-May-04 3:35
David Crow10-May-04 3:35 
zaferaslan wrote:
As I understand, I should use pointer type variable as Jens kindly proposed;

float *p= new float [1000*1000*100];


Yes, that's the ticket. The problem here is that it requires you to convert the three indices by proper scaling, e.g., to access the i, j, k element of the array, the subscript is

i + j * 1000 + k * 1000 * 100
or some variant on the above. You can't access it as pArray[i][j][k].

zaferaslan wrote:
However, is there any other way?

Yes. Try:

int * * * p = new int**[FirstDimension];
for(int i = 0; i < FirstDimension; i++)
{
    p[i] = new int *[SecondDimension];
    for(int j = 0; j < SecondDimension; j++)
    {
        p[i][j] = new int[ThirdDimension];
        for(int k = 0; k < ThirdDimension; k++)
            p[i][j][k] = 0;
    }
}
zaferaslan wrote:
I need the variable in three dimensional array form and this approach generally causes lose of data during long executions.

You shouldn't be losing data. If so, something else is wrong.


"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)


GeneralRe:David - Maximum ARRAY SIZE? Thanks Pin
zaferaslan10-May-04 20:26
zaferaslan10-May-04 20:26 
AnswerRe: Maximum ARRAY SIZE? Pin
Bob Stanneveld10-May-04 8:23
Bob Stanneveld10-May-04 8:23 
GeneralRe: Bob - Maximum ARRAY SIZE? Pin
zaferaslan10-May-04 20:15
zaferaslan10-May-04 20:15 
GeneralRe: Bob - Maximum ARRAY SIZE? Pin
Bob Stanneveld11-May-04 0:52
Bob Stanneveld11-May-04 0:52 
GeneralRe: Bob - Maximum ARRAY SIZE? Thanks Pin
zaferaslan11-May-04 4:59
zaferaslan11-May-04 4:59 
GeneralCCryptMD5Hash Pin
Ni@m9-May-04 23:56
Ni@m9-May-04 23:56 
GeneralRe: CCryptMD5Hash Pin
Garth J Lancaster10-May-04 0:13
professionalGarth J Lancaster10-May-04 0:13 
GeneralSerial Communication Timing Problem Pin
louis9-May-04 23:54
louis9-May-04 23:54 
GeneralRe: Serial Communication Timing Problem Pin
Andrew Walker10-May-04 1:37
Andrew Walker10-May-04 1:37 
GeneralRe: Serial Communication Timing Problem Pin
louis10-May-04 23:45
louis10-May-04 23:45 
GeneralAGP Detection Pin
anyata9-May-04 23:41
anyata9-May-04 23:41 
Generalmemory mapped files Pin
flabster9-May-04 22:33
flabster9-May-04 22:33 
GeneralRe: memory mapped files Pin
flabster10-May-04 17:59
flabster10-May-04 17:59 
General830221 - weird! Pin
ilostmyid29-May-04 21:37
professionalilostmyid29-May-04 21:37 
GeneralRe: 830221 - weird! Pin
V.10-May-04 2:40
professionalV.10-May-04 2:40 
GeneralPROGGRAMMING USING DIALOGUE BOXES INSTEAD OF DOCUMENT FORMS Pin
Wisdom20049-May-04 21:29
Wisdom20049-May-04 21:29 
GeneralRe: PROGGRAMMING USING DIALOGUE BOXES INSTEAD OF DOCUMENT FORMS Pin
David Crow10-May-04 2:52
David Crow10-May-04 2:52 

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.