Click here to Skip to main content
16,019,427 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Active window Pin
jk chan23-Aug-06 14:15
jk chan23-Aug-06 14:15 
AnswerRe: Active window Pin
jpyp24-Aug-06 8:11
jpyp24-Aug-06 8:11 
GeneralRe: Active window Pin
jk chan24-Aug-06 14:25
jk chan24-Aug-06 14:25 
QuestionCMap with integer keys [modified] Pin
bob1697222-Aug-06 10:16
bob1697222-Aug-06 10:16 
AnswerRe: CMap with integer keys Pin
Jörgen Sigvardsson22-Aug-06 13:56
Jörgen Sigvardsson22-Aug-06 13:56 
GeneralRe: CMap with integer keys [modified] Pin
bob1697222-Aug-06 18:37
bob1697222-Aug-06 18:37 
GeneralRe: CMap with integer keys Pin
Blake Miller29-Sep-06 8:37
Blake Miller29-Sep-06 8:37 
GeneralRe: CMap with integer keys Pin
bob169721-Oct-06 7:56
bob169721-Oct-06 7:56 
Yes. You should make the lookup table roughly 20% larger than the expected maximum number of entries. Of course, for very large maps, memory considerations may make smaller tables practical if the resultant linear searches are expected to be short. In your case 20000 values of type WORD seems reasonable so I would follow the above rule and make the table 120% of 20000 which is 24000. This number should be prime so 24001 would suffice.

However, if your keys values ARE the integers between 0 and 20000 or some sequence of consecutive numbers then an array would suffice since no hashing would be required to determine the index or placement.

Hope that helps,

Take care
GeneralRe: CMap with integer keys Pin
Blake Miller2-Oct-06 2:22
Blake Miller2-Oct-06 2:22 
Questionfunction hooks Pin
inebriate22-Aug-06 8:55
inebriate22-Aug-06 8:55 
AnswerRe: function hooks Pin
Jörgen Sigvardsson22-Aug-06 13:54
Jörgen Sigvardsson22-Aug-06 13:54 
AnswerRe: function hooks Pin
Dave Calkins22-Aug-06 18:15
Dave Calkins22-Aug-06 18:15 
Questionexceptions Pin
jon-8022-Aug-06 8:48
professionaljon-8022-Aug-06 8:48 
QuestionRe: exceptions Pin
David Crow22-Aug-06 8:57
David Crow22-Aug-06 8:57 
AnswerRe: exceptions Pin
jon-8022-Aug-06 9:06
professionaljon-8022-Aug-06 9:06 
GeneralRe: exceptions Pin
Zac Howland22-Aug-06 9:10
Zac Howland22-Aug-06 9:10 
GeneralRe: exceptions Pin
David Crow22-Aug-06 9:21
David Crow22-Aug-06 9:21 
GeneralRe: exceptions Pin
Zac Howland22-Aug-06 9:22
Zac Howland22-Aug-06 9:22 
QuestionRe: exceptions Pin
David Crow22-Aug-06 9:32
David Crow22-Aug-06 9:32 
AnswerRe: exceptions Pin
Zac Howland22-Aug-06 9:42
Zac Howland22-Aug-06 9:42 
GeneralRe: exceptions Pin
David Crow22-Aug-06 9:47
David Crow22-Aug-06 9:47 
GeneralRe: exceptions Pin
Zac Howland22-Aug-06 10:08
Zac Howland22-Aug-06 10:08 
GeneralRe: exceptions Pin
David Crow22-Aug-06 10:25
David Crow22-Aug-06 10:25 
GeneralRe: exceptions Pin
Zac Howland22-Aug-06 13:34
Zac Howland22-Aug-06 13:34 
AnswerRe: exceptions Pin
Zac Howland22-Aug-06 9:09
Zac Howland22-Aug-06 9:09 

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.