Click here to Skip to main content
15,914,165 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Error while compiling code Pin
izyani4-Nov-08 21:33
izyani4-Nov-08 21:33 
QuestionLoadBitMap giving error Pin
Dhiraj kumar Saini3-Nov-08 22:13
Dhiraj kumar Saini3-Nov-08 22:13 
AnswerRe: LoadBitMap giving error Pin
CPallini3-Nov-08 22:46
mveCPallini3-Nov-08 22:46 
GeneralRe: LoadBitMap giving error Pin
Dhiraj kumar Saini3-Nov-08 22:56
Dhiraj kumar Saini3-Nov-08 22:56 
QuestionRe: LoadBitMap giving error Pin
CPallini3-Nov-08 23:30
mveCPallini3-Nov-08 23:30 
AnswerRe: LoadBitMap giving error Pin
Dhiraj kumar Saini3-Nov-08 23:56
Dhiraj kumar Saini3-Nov-08 23:56 
QuestionVisual Studio 2005 Tiny Cursor Pin
Daniel Kanev3-Nov-08 21:43
Daniel Kanev3-Nov-08 21:43 
QuestionUpdating a SLT map Pin
CodingLover3-Nov-08 21:39
CodingLover3-Nov-08 21:39 
Hi all,

I want to store some data in a map as a pair. Just see what I have done in the following code, then you can have a clear idea.

<br />
	string user_key[5] = {"cocacola", "pepsi", "cocacola", "mango", "pepsi"};<br />
	int comm_val[5] = {23, 45, 24, 67, 98};<br />
	<br />
	map<const string, int>	comm_map; // map to store data<br />
	map<const string, int>::const_iterator iter;<br />
<br />
	// Store data<br />
	for(int i = 0; i < 5; i++)<br />
	{<br />
		iter = comm_map.find(user_key[i]);<br />
<br />
		if(iter == comm_map.end())<br />
		{<br />
			// not found<br />
			comm_map.insert(pair<const string, int>(user_key[i], comm_val[i]));<br />
		}<br />
		else<br />
		{<br />
			// found<br />
			(*iter).second = comm_val[i]; // I'm stuck here<br />
		}		<br />
	}<br />
<br />
	// Check result<br />
	for(iter = comm_map.begin(); iter != comm_map.end(); iter++)<br />
	{<br />
		string rec = iter->first;<br />
		int val = iter->second;<br />
<br />
		cout << rec << "\t" << val << endl;<br />
	}<br />
<br />
	/*<br />
		cocacola	24<br />
		pepsi		98<br />
		mango		67<br />
	*/<br />


My result should be as commented at last of the code. Can you help me to fix it.

Thanks

I appreciate your help all the time...
CodingLover Smile | :)

NewsRe: Updating a SLT map Pin
CodingLover3-Nov-08 21:44
CodingLover3-Nov-08 21:44 
QuestionCreate two executable files ( one GUI and one command line ) Pin
Arif Liminto3-Nov-08 20:51
professionalArif Liminto3-Nov-08 20:51 
AnswerRe: Create two executable files ( one GUI and one command line ) Pin
Cedric Moonen3-Nov-08 20:56
Cedric Moonen3-Nov-08 20:56 
GeneralRe: Create two executable files ( one GUI and one command line ) Pin
Arif Liminto3-Nov-08 21:11
professionalArif Liminto3-Nov-08 21:11 
GeneralRe: Create two executable files ( one GUI and one command line ) Pin
Cedric Moonen4-Nov-08 1:16
Cedric Moonen4-Nov-08 1:16 
GeneralRe: Create two executable files ( one GUI and one command line ) Pin
Arif Liminto5-Nov-08 15:16
professionalArif Liminto5-Nov-08 15:16 
AnswerRe: Create two executable files ( one GUI and one command line ) Pin
KarstenK3-Nov-08 21:16
mveKarstenK3-Nov-08 21:16 
QuestionHow to block right click menu (Context Menu) on MS-Office documents. Pin
SNI3-Nov-08 19:41
SNI3-Nov-08 19:41 
AnswerRe: How to block right click menu (Context Menu) on MS-Office documents. Pin
Nishad S4-Nov-08 1:45
Nishad S4-Nov-08 1:45 
QuestionSmartDevice (wincows mobile) program Pin
zon_cpp3-Nov-08 19:23
zon_cpp3-Nov-08 19:23 
Questiondiffrence between IT and IAT Pin
zon_cpp3-Nov-08 19:21
zon_cpp3-Nov-08 19:21 
QuestionCreating a csv file in a dialog based MFC application Pin
SeshaSridhar3-Nov-08 19:08
SeshaSridhar3-Nov-08 19:08 
AnswerRe: Creating a csv file in a dialog based MFC application Pin
Chandrasekharan P3-Nov-08 19:19
Chandrasekharan P3-Nov-08 19:19 
AnswerRe: Creating a csv file in a dialog based MFC application Pin
Hamid_RT3-Nov-08 19:28
Hamid_RT3-Nov-08 19:28 
Questionhow to use WriteProfileString and GetProfileString MFC functions??? Pin
anna mathew3-Nov-08 19:02
anna mathew3-Nov-08 19:02 
AnswerRe: how to use WriteProfileString and GetProfileString MFC functions??? Pin
Hamid_RT3-Nov-08 19:26
Hamid_RT3-Nov-08 19:26 
AnswerRe: how to use WriteProfileString and GetProfileString MFC functions??? Pin
CPallini3-Nov-08 22:02
mveCPallini3-Nov-08 22:02 

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.