Click here to Skip to main content
15,888,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to find change in display ? Pin
Jijo.Raj24-Apr-04 22:33
Jijo.Raj24-Apr-04 22:33 
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 
<br />
typedef struct{<br />
  char buff[20];<br />
} my_struct;<br />
<br />
my_struct my_arr[1000][30][10][10][3];<br />
<br />
int main(){    <br />
  for ( int a = 0; a < 1000; ++a )        <br />
  for ( int b = 0; b < 30; ++b )            <br />
  for ( int c = 0; c < 10; ++c )                <br />
  for ( int d = 0; d < 10; ++d )                    <br />
  for ( int e = 0; e < 3; ++e )                    <br />
  {                        <br />
    my_arr[a][b][c][d][e].buff[0]='0';<br />
    my_arr[a][b][c][d][e].buff[19]='9';<br />
  }<br />
  return 0;<br />
}<br />


In previous thread, I have asked about the problem when using large data. Thanks so much for all of your replying.

I based on yours comment to check my code again and I found that I had a mistake. Yes, the program run normally.

Here I had changed code to another type:

<br />
typedef struct{<br />
  CByteArray buff;<br />
} my_struct;<br />
<br />
typedef struct{<br />
  my_struct dat[30][10][10][3];<br />
} data;<br />
<br />
CArray<data, data&> my_arr;<br />


In CWinApp::InitInstance():
<br />
  int n=1000<br />
  my_arr.SetSize(n);<br />
  for ( int a = 0; a < n; ++a )        <br />
  for ( int b = 0; b < 30; ++b )            <br />
  for ( int c = 0; c < 10; ++c )                <br />
  for ( int d = 0; d < 10; ++d )                    <br />
  for ( int e = 0; e < 3; ++e )                    <br />
  {                        <br />
    my_arr[a].dat[b][c][d][e].buff.SetSize(1);<br />
  }<br />
}<br />

I tested n from 100 to 1000 and CArray seem to be not effective. When n>=500, the program run more slowly. And when n=1000, the system alerted that out of virtual memory.
Please note that the buff size is only 1 (beside 20 in previous version)

In my project, buff size is varying.
n is about 300-800
All remaining size of array are const

Here are my questions:

In this case, which is my best solution (Using CArray or not)?

If anyone has experience in using CArray and processing large data, please give me a hint.

Thank you very much.
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 
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 

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.