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

C / C++ / MFC

 
GeneralRe: My second time to design a website... Pin
JackPuppy11-Mar-09 3:35
JackPuppy11-Mar-09 3:35 
GeneralRe: My second time to design a website... Pin
Hamid_RT11-Mar-09 7:49
Hamid_RT11-Mar-09 7:49 
GeneralRe: My second time to design a website... Pin
JackPuppy11-Mar-09 18:13
JackPuppy11-Mar-09 18:13 
AnswerRe: My second time to design a website... Pin
Stuart Dootson11-Mar-09 3:54
professionalStuart Dootson11-Mar-09 3:54 
QuestionUnordered Map Pin
CyanCrey11-Mar-09 1:52
CyanCrey11-Mar-09 1:52 
AnswerRe: Unordered Map Pin
Stuart Dootson11-Mar-09 3:52
professionalStuart Dootson11-Mar-09 3:52 
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 
It won't hash the strings - you use hash_map for that (although in my experience, std::map has better performance).

But it will compare strings properly - I guess it'll use operator<?

BTW - this code worked fine on g++ 4.0.1 (using Boost's TR1 implementation) and on VS2008 (using its own TR1):

#include <string>
#include <iostream>
#include <unordered_map>

int _tmain(int argc, _TCHAR* argv[])
{
   std::tr1::unordered_map<std::string, int> a;
   a.insert(std::make_pair("Hello", 10));
   a.insert(std::make_pair("Goodbye", 20));

   std::cout << a.count("test") << std::endl;
   std::cout << a.count("Hello") << std::endl;

   return 0;
}


This does comparisons...

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

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 
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 

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.