Click here to Skip to main content
15,910,211 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionsorting arrays?? Pin
2-Feb-02 19:08
suss2-Feb-02 19:08 
AnswerRe: sorting arrays?? Pin
Paul M Watt2-Feb-02 19:58
mentorPaul M Watt2-Feb-02 19:58 
AnswerRe: sorting arrays?? Pin
alex.barylski2-Feb-02 19:59
alex.barylski2-Feb-02 19:59 
AnswerRe: sorting arrays?? Pin
Christian Graus3-Feb-02 2:14
protectorChristian Graus3-Feb-02 2:14 
Questioninsert elements in order??? Pin
2-Feb-02 17:12
suss2-Feb-02 17:12 
AnswerRe: insert elements in order??? Pin
Paul M Watt2-Feb-02 17:41
mentorPaul M Watt2-Feb-02 17:41 
GeneralRe: insert elements in order??? Pin
2-Feb-02 17:52
suss2-Feb-02 17:52 
GeneralRe: insert elements in order??? Pin
Paul M Watt2-Feb-02 18:53
mentorPaul M Watt2-Feb-02 18:53 
How are you going to access the array? If you want to perform a lookup based on the name of teh stock, I would simply use the STL map. You can add items and it will automatically sort the items. So if you use an iterator to view all of the objects in your map, they will be sorted.

Also you can create a map like this:

<br />
map<char*, CStock*> mapStock;<br />


then you can add items like this:

<br />
mapStock["msft"] = new CStock(...); <br />


and you can later access the object like this:

<br />
CStock *stock = mapStock["msft"];<br />


It is a pretty easy container to use, it sounds like it would be a good fit for your case.
Generallooking for a program Pin
A.D2-Feb-02 15:15
A.D2-Feb-02 15:15 
GeneralRe: looking for a program Pin
antoine@orchus-tech2-Feb-02 16:59
antoine@orchus-tech2-Feb-02 16:59 
GeneralRe: looking for a program Pin
A.D2-Feb-02 17:26
A.D2-Feb-02 17:26 
GeneralRe: looking for a program Pin
moliate4-Feb-02 12:09
moliate4-Feb-02 12:09 
GeneralList Control Space Bug Pin
Swinefeaster2-Feb-02 14:55
Swinefeaster2-Feb-02 14:55 
QuestionWTL::CDragListBox Example? Pin
Henry Jacobs2-Feb-02 13:07
Henry Jacobs2-Feb-02 13:07 
Generalmultiple windows in MFC C++ Pin
2-Feb-02 10:51
suss2-Feb-02 10:51 
GeneralRe: multiple windows in MFC C++ Pin
Mazdak2-Feb-02 10:57
Mazdak2-Feb-02 10:57 
GeneralRe: multiple windows in MFC C++ Pin
2-Feb-02 11:20
suss2-Feb-02 11:20 
GeneralRe: multiple windows in MFC C++ Pin
Mazdak2-Feb-02 11:56
Mazdak2-Feb-02 11:56 
GeneralRe: multiple windows in MFC C++ Pin
Mazdak2-Feb-02 12:13
Mazdak2-Feb-02 12:13 
GeneralRe: multiple windows in MFC C++ Pin
2-Feb-02 12:18
suss2-Feb-02 12:18 
GeneralRe: multiple windows in MFC C++ Pin
alex.barylski2-Feb-02 13:19
alex.barylski2-Feb-02 13:19 
QuestionUsing CMsFlexGrid on other machines (without visual c++ installed)? Pin
DanYELL2-Feb-02 9:15
DanYELL2-Feb-02 9:15 
AnswerRe: Using CMsFlexGrid on other machines (without visual c++ installed)? Pin
Mazdak2-Feb-02 10:36
Mazdak2-Feb-02 10:36 
AnswerRe: Using CMsFlexGrid on other machines (without visual c++ installed)? Pin
Mazdak2-Feb-02 10:44
Mazdak2-Feb-02 10:44 
GeneralCalendar Week Problem Pin
Sonu Kapoor2-Feb-02 8:51
Sonu Kapoor2-Feb-02 8:51 

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.