Click here to Skip to main content
16,005,682 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDate class question Pin
philll22-Aug-02 17:22
philll22-Aug-02 17:22 
GeneralRe: Date class question Pin
Chris Losinger22-Aug-02 17:25
professionalChris Losinger22-Aug-02 17:25 
GeneralRe: Date class question Pin
philll22-Aug-02 17:29
philll22-Aug-02 17:29 
GeneralRe: Date class question Pin
Chris Losinger22-Aug-02 17:33
professionalChris Losinger22-Aug-02 17:33 
GeneralRe: Date class question Pin
philll22-Aug-02 17:41
philll22-Aug-02 17:41 
QuestionWhich STL container to choose? Pin
ns22-Aug-02 16:50
ns22-Aug-02 16:50 
AnswerRe: Which STL container to choose? Pin
Todd Smith22-Aug-02 17:19
Todd Smith22-Aug-02 17:19 
AnswerRe: Which STL container to choose? Pin
Paul M Watt22-Aug-02 19:15
mentorPaul M Watt22-Aug-02 19:15 
I would choose a set.

A set will only allow one instance of the type that specify to be inserted. Use the insert member function of the set to insert the CString in the set.

The insert function returns a pair<set<CString>, bool> object to indicate if the function succeeded or not. THe iterator will contain the iter of the object that was inserted, and the bool will indicate if the insertion actually occured.

If the insertion occured then true will be returned, otherwise if the item already existed the bool will be false.

The standard implementation of a set is with a Red-Balck tree, which is a balnaced binary search tree. So you will get n log(n) lookup times. If you would rather use a hash implementation you can switch to the SGI or Boost implementations which both have hash implementations. Hash implementations have faster lookups than trees, however they require more space as well.

Good Luck.


Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

GeneralRe: Which STL container to choose? Pin
Tomasz Sowinski22-Aug-02 22:16
Tomasz Sowinski22-Aug-02 22:16 
GeneralRe: Which STL container to choose? Pin
Paul M Watt22-Aug-02 22:47
mentorPaul M Watt22-Aug-02 22:47 
GeneralThanks everyone! Pin
ns23-Aug-02 3:05
ns23-Aug-02 3:05 
Questioncan I have two command objects w same connection? Pin
ns22-Aug-02 16:34
ns22-Aug-02 16:34 
AnswerRe: can I have two command objects w same connection? Pin
Le centriste22-Aug-02 18:18
Le centriste22-Aug-02 18:18 
GeneralThanks for your responses. Pin
ns23-Aug-02 3:08
ns23-Aug-02 3:08 
AnswerRe: can I have two command objects w same connection? Pin
Michael P Butler23-Aug-02 0:52
Michael P Butler23-Aug-02 0:52 
GeneralIs this correct? new char of length.... Pin
ns22-Aug-02 15:02
ns22-Aug-02 15:02 
GeneralRe: Is this correct? new char of length.... Pin
Christian Graus22-Aug-02 15:44
protectorChristian Graus22-Aug-02 15:44 
GeneralRe: Is this correct? new char of length.... Pin
Tim Smith22-Aug-02 15:42
Tim Smith22-Aug-02 15:42 
GeneralDifference between WM_USER and WM_APP Pin
alschneider22-Aug-02 12:16
alschneider22-Aug-02 12:16 
GeneralRe: Difference between WM_USER and WM_APP Pin
Michael Dunn22-Aug-02 13:53
sitebuilderMichael Dunn22-Aug-02 13:53 
GeneralRe: Difference between WM_USER and WM_APP Pin
Nish Nishant22-Aug-02 14:36
sitebuilderNish Nishant22-Aug-02 14:36 
QuestionHow to create a net share to a specific user remotly? Pin
Anonymous22-Aug-02 11:23
Anonymous22-Aug-02 11:23 
GeneralRebase does not strip my debug symbols Pin
Ernesto Perales Soto22-Aug-02 11:18
Ernesto Perales Soto22-Aug-02 11:18 
GeneralRe: Rebase does not strip my debug symbols Pin
Mike Nordell25-Aug-02 3:32
Mike Nordell25-Aug-02 3:32 
GeneralRe: Rebase does not strip my debug symbols Pin
Ernesto Perales Soto26-Aug-02 3:19
Ernesto Perales Soto26-Aug-02 3:19 

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.