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

C / C++ / MFC

 
GeneralRe: Unordered Map Pin
CyanCrey11-Mar-09 8:19
CyanCrey11-Mar-09 8:19 
GeneralRe: Unordered Map Pin
Stuart Dootson11-Mar-09 8:32
professionalStuart Dootson11-Mar-09 8:32 
GeneralRe: Unordered Map Pin
CyanCrey12-Mar-09 12:47
CyanCrey12-Mar-09 12:47 
QuestionSorting algorithm Pin
brucewayn11-Mar-09 1:31
brucewayn11-Mar-09 1:31 
AnswerRe: Sorting algorithm Pin
quixqx11-Mar-09 1:53
quixqx11-Mar-09 1:53 
AnswerRe: Sorting algorithm Pin
Swapnil Shah11-Mar-09 1:58
Swapnil Shah11-Mar-09 1:58 
AnswerRe: Sorting algorithm Pin
CPallini11-Mar-09 2:41
mveCPallini11-Mar-09 2:41 
AnswerRe: Sorting algorithm Pin
Stuart Dootson11-Mar-09 3:47
professionalStuart Dootson11-Mar-09 3:47 
If you used this:

std::map<MarkType, NameType> marksAndStudents;


(where MarkType is the type you use for a students marks and NameType is the type you use for a students name, then *rbegin() points at the student with the highest mark - try this:

std::map<int, std::string> s;
s.insert(std::make_pair(10, "10"));
s.insert(std::make_pair(20, "20"));
s.insert(std::make_pair(30, "30"));
s.insert(std::make_pair(40, "40"));
s.insert(std::make_pair(50, "50"));
s.insert(std::make_pair(60, "60"));
s.insert(std::make_pair(70, "70"));
s.insert(std::make_pair(80, "80"));
s.insert(std::make_pair(90, "90"));
s.insert(std::make_pair(100, "100"));
s.insert(std::make_pair(110, "110"));
s.insert(std::make_pair(120, "120"));

std::map<int, std::string>::const_reverse_iterator it = s.rbegin();
for (int i=0;i<10;++i)
{
   std::cout << it->second << std::endl;++it;
}


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

Questionpthread in c++ (LINUX) Pin
quixqx11-Mar-09 0:50
quixqx11-Mar-09 0:50 
AnswerRe: pthread in c++ (LINUX) Pin
markkuk11-Mar-09 1:07
markkuk11-Mar-09 1:07 
GeneralRe: pthread in c++ (LINUX) Pin
quixqx11-Mar-09 1:34
quixqx11-Mar-09 1:34 
QuestionEdit & print PCL generated PRN file Pin
balu1234511-Mar-09 0:09
balu1234511-Mar-09 0:09 
AnswerRe: Edit & print PCL generated PRN file Pin
Iain Clarke, Warrior Programmer11-Mar-09 0:40
Iain Clarke, Warrior Programmer11-Mar-09 0:40 
GeneralRe: Edit & print PCL generated PRN file Pin
balu1234511-Mar-09 3:38
balu1234511-Mar-09 3:38 
GeneralRe: Edit & print PCL generated PRN file Pin
Iain Clarke, Warrior Programmer11-Mar-09 4:00
Iain Clarke, Warrior Programmer11-Mar-09 4:00 
Questionvariable declaration dought Pin
Deepu Antony11-Mar-09 0:09
Deepu Antony11-Mar-09 0:09 
AnswerRe: variable declaration dought Pin
«_Superman_»11-Mar-09 0:11
professional«_Superman_»11-Mar-09 0:11 
GeneralRe: variable declaration dought Pin
Deepu Antony11-Mar-09 0:22
Deepu Antony11-Mar-09 0:22 
QuestionHow to get the length of a byte pointer ? Pin
kapardhi11-Mar-09 0:03
kapardhi11-Mar-09 0:03 
AnswerRe: How to get the length of a byte pointer ? Pin
«_Superman_»11-Mar-09 0:09
professional«_Superman_»11-Mar-09 0:09 
AnswerRe: How to get the length of a byte pointer ? Pin
Code-o-mat11-Mar-09 0:36
Code-o-mat11-Mar-09 0:36 
QuestionA small dbt Pin
Cool_Phillip10-Mar-09 23:43
Cool_Phillip10-Mar-09 23:43 
AnswerRe: A small dbt Pin
Stephen Hewitt10-Mar-09 23:47
Stephen Hewitt10-Mar-09 23:47 
GeneralRe: A small dbt Pin
Cool_Phillip11-Mar-09 2:31
Cool_Phillip11-Mar-09 2:31 
AnswerRe: A small dbt Pin
«_Superman_»11-Mar-09 0:13
professional«_Superman_»11-Mar-09 0:13 

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.