Click here to Skip to main content
15,889,116 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSorting a vector of non-primitive data types (structs) Pin
all_in_flames27-Mar-07 3:08
professionalall_in_flames27-Mar-07 3:08 
AnswerRe: Sorting a vector of non-primitive data types (structs) Pin
Christian Graus27-Mar-07 3:12
protectorChristian Graus27-Mar-07 3:12 
AnswerRe: Sorting a vector of non-primitive data types (structs) Pin
Stephen Hewitt27-Mar-07 4:05
Stephen Hewitt27-Mar-07 4:05 
GeneralRe: Sorting a vector of non-primitive data types (structs) Pin
all_in_flames27-Mar-07 5:16
professionalall_in_flames27-Mar-07 5:16 
GeneralRe: Sorting a vector of non-primitive data types (structs) Pin
Christian Graus27-Mar-07 6:02
protectorChristian Graus27-Mar-07 6:02 
GeneralRe: Sorting a vector of non-primitive data types (structs) Pin
Stephen Hewitt27-Mar-07 13:33
Stephen Hewitt27-Mar-07 13:33 
GeneralRe: Sorting a vector of non-primitive data types (structs) Pin
Stephen Hewitt27-Mar-07 13:33
Stephen Hewitt27-Mar-07 13:33 
QuestionRe: Sorting a vector of non-primitive data types (structs) Pin
all_in_flames27-Mar-07 12:12
professionalall_in_flames27-Mar-07 12:12 
Thanks again for all your help, gentlemen. I got the sorting working with no more problems.
However, now that I have moved on to the searching portion, I find that the way the project is designed,
I have to search for values in the structs that are NOT strings.

To refresh your memory:
struct Wizard
{
string FirstName;
string LastName;
int Grade;
double WandWeight;
};

Is there any viable way to convert a string to an int, a string to a double, or vice versa?
I have attempted to use static_cast<string>() on the int and double values, and static_cast<int>() / static_cast<double>() on the string values, but the compiler didn't like those conversions.

I have looked around, and there is nothing available to me without downloading someone's class and using it. Since this is a school project, I have a feeling that would be frowned upon.

Any ideas?

If any clarification is needed, simply ask.
AnswerRe: Sorting a vector of non-primitive data types (structs) Pin
Stephen Hewitt27-Mar-07 13:47
Stephen Hewitt27-Mar-07 13:47 
GeneralRe: Sorting a vector of non-primitive data types (structs) Pin
all_in_flames27-Mar-07 13:54
professionalall_in_flames27-Mar-07 13:54 
GeneralRe: Sorting a vector of non-primitive data types (structs) Pin
Stephen Hewitt27-Mar-07 13:57
Stephen Hewitt27-Mar-07 13:57 
AnswerRe: Sorting a vector of non-primitive data types (structs) Pin
Michael Dunn27-Mar-07 20:36
sitebuilderMichael Dunn27-Mar-07 20:36 
GeneralRe: Sorting a vector of non-primitive data types (structs) Pin
all_in_flames28-Mar-07 2:16
professionalall_in_flames28-Mar-07 2:16 
Questionlparam and wparam Pin
Try27-Mar-07 2:59
Try27-Mar-07 2:59 
AnswerRe: lparam and wparam Pin
David Crow27-Mar-07 3:03
David Crow27-Mar-07 3:03 
QuestionRe: lparam and wparam Pin
Try27-Mar-07 3:12
Try27-Mar-07 3:12 
AnswerRe: lparam and wparam Pin
David Crow27-Mar-07 3:18
David Crow27-Mar-07 3:18 
GeneralRe: lparam and wparam Pin
Michael Dunn27-Mar-07 20:40
sitebuilderMichael Dunn27-Mar-07 20:40 
AnswerRe: lparam and wparam Pin
prasad_som27-Mar-07 4:00
prasad_som27-Mar-07 4:00 
AnswerRe: lparam and wparam Pin
Christian Graus27-Mar-07 3:04
protectorChristian Graus27-Mar-07 3:04 
GeneralRe: lparam and wparam Pin
Mark Salsbery27-Mar-07 7:10
Mark Salsbery27-Mar-07 7:10 
Questionlearning multithreading Pin
l_d27-Mar-07 2:44
l_d27-Mar-07 2:44 
AnswerRe: learning multithreading Pin
David Crow27-Mar-07 2:45
David Crow27-Mar-07 2:45 
AnswerRe: learning multithreading Pin
Roger Stoltz27-Mar-07 2:46
Roger Stoltz27-Mar-07 2:46 
AnswerRe: learning multithreading Pin
Try27-Mar-07 2:46
Try27-Mar-07 2:46 

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.