Click here to Skip to main content
15,916,945 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to find change in display ? Pin
User 665825-Apr-04 0:30
User 665825-Apr-04 0:30 
GeneralRe: How to find change in display ? Pin
Jijo.Raj25-Apr-04 3:11
Jijo.Raj25-Apr-04 3:11 
GeneralRe: How to find change in display ? Pin
grigsoft25-Apr-04 5:31
grigsoft25-Apr-04 5:31 
GeneralRe: How to find change in display ? Pin
Jijo.Raj25-Apr-04 21:03
Jijo.Raj25-Apr-04 21:03 
GeneralRe: How to find change in display ? Pin
grigsoft25-Apr-04 21:16
grigsoft25-Apr-04 21:16 
GeneralRe: How to find change in display ? Pin
Jijo.Raj26-Apr-04 2:40
Jijo.Raj26-Apr-04 2:40 
GeneralHow's about memory size usage Pin
nguyenvhn24-Apr-04 20:11
nguyenvhn24-Apr-04 20:11 
GeneralRe: How's about memory size usage Pin
Mike Nordell25-Apr-04 6:19
Mike Nordell25-Apr-04 6:19 
GeneralRe: How's about memory size usage Pin
nguyenvhn25-Apr-04 21:23
nguyenvhn25-Apr-04 21:23 
GeneralRe: How's about memory size usage Pin
Mike Nordell26-Apr-04 4:14
Mike Nordell26-Apr-04 4:14 
GeneralRe: How's about memory size usage Pin
Paul Ranson25-Apr-04 6:45
Paul Ranson25-Apr-04 6:45 
GeneralRe: How's about memory size usage Pin
nguyenvhn25-Apr-04 21:38
nguyenvhn25-Apr-04 21:38 
GeneralRe: How's about memory size usage Pin
Paul Ranson26-Apr-04 1:16
Paul Ranson26-Apr-04 1:16 
If your 'my_struct' can remain 20 bytes then the following works for variable 'C', I don't recommend any type of container since the overhead of managing it and implementing 'operator[]' is probably going to be significant.

The total allocation is 180MB, this is much less than commonly fitted as main RAM to modern PCs so the quantitiy per se isn't too much. You do need to consider how you access it in order to work with the CPU data caches rather than against them, but without knowing what you do to the data I can't help there.

struct my_struct
{
    char buff [ 20 ] ;
} ;

typedef my_struct my_struct_array [ 30 ][ 10 ][ 10 ][ 3 ] ;
const unsigned my_arr_size = 1000 ;

int main()
{
    my_struct_array * my_arr = new my_struct_array [ my_arr_size ] ;

    for ( unsigned a = 0; a < my_arr_size; ++a )
        for ( unsigned b = 0; b < 30; ++b )
            for ( unsigned c = 0; c < 10; ++c )
                for ( unsigned d = 0; d < 10; ++d )
                    for ( unsigned e = 0; e < 3; ++e )
                    {
                        my_arr [ a ][ b ][ c ][ d ][ e ].buff [ 0 ] = '0' ;
                        my_arr [ a ][ b ][ c ][ d ][ e ].buff [ 19 ] = '9' ;
                    }
    delete [] my_arr ;

    return 0;
}


Paul
GeneralRe: How's about memory size usage Pin
nguyenvhn26-Apr-04 15:16
nguyenvhn26-Apr-04 15:16 
GeneralHash Table Pin
Member 104413524-Apr-04 20:04
Member 104413524-Apr-04 20:04 
GeneralRe: Hash Table Pin
Garth J Lancaster24-Apr-04 21:38
professionalGarth J Lancaster24-Apr-04 21:38 
GeneralRe: Hash Table Pin
Prakash Nadar24-Apr-04 22:39
Prakash Nadar24-Apr-04 22:39 
GeneralRe: Hash Table Pin
DougW4824-Apr-04 21:50
DougW4824-Apr-04 21:50 
GeneralRe: Hash Table Pin
Garth J Lancaster25-Apr-04 1:08
professionalGarth J Lancaster25-Apr-04 1:08 
GeneralRe: Hash Table Pin
David Crow26-Apr-04 3:05
David Crow26-Apr-04 3:05 
GeneralService question Pin
tank102524-Apr-04 17:45
tank102524-Apr-04 17:45 
GeneralFunction/ read file Pin
Sarah Shy24-Apr-04 15:03
sussSarah Shy24-Apr-04 15:03 
GeneralRe: Function/ read file Pin
wb24-Apr-04 19:35
wb24-Apr-04 19:35 
GeneralRe: Function/ read file Pin
sarah shy25-Apr-04 3:27
susssarah shy25-Apr-04 3:27 
GeneralHELP WITH CODE Pin
Anonymous25-Apr-04 3:54
Anonymous25-Apr-04 3:54 

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.