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

C / C++ / MFC

 
GeneralRe: How to handle breaks during debugging Pin
prithaa5-Sep-09 20:19
prithaa5-Sep-09 20:19 
GeneralRe: How to handle breaks during debugging Pin
Stuart Dootson5-Sep-09 23:36
professionalStuart Dootson5-Sep-09 23:36 
GeneralRe: How to handle breaks during debugging Pin
prithaa6-Sep-09 0:20
prithaa6-Sep-09 0:20 
GeneralRe: How to handle breaks during debugging Pin
Stuart Dootson6-Sep-09 0:57
professionalStuart Dootson6-Sep-09 0:57 
GeneralRe: How to handle breaks during debugging Pin
prithaa6-Sep-09 1:00
prithaa6-Sep-09 1:00 
GeneralRe: How to handle breaks during debugging Pin
Stuart Dootson6-Sep-09 1:03
professionalStuart Dootson6-Sep-09 1:03 
GeneralRe: How to handle breaks during debugging Pin
iraclyKv6-Sep-09 23:50
iraclyKv6-Sep-09 23:50 
AnswerRe: How to handle breaks during debugging Pin
Iain Clarke, Warrior Programmer6-Sep-09 9:25
Iain Clarke, Warrior Programmer6-Sep-09 9:25 
GeneralRe: How to handle breaks during debugging Pin
prithaa6-Sep-09 19:11
prithaa6-Sep-09 19:11 
QuestionCalling Unmanaged Class From DLL Pin
İsmail Durmaz5-Sep-09 5:27
İsmail Durmaz5-Sep-09 5:27 
AnswerRe: Calling Unmanaged Class From DLL Pin
«_Superman_»5-Sep-09 5:34
professional«_Superman_»5-Sep-09 5:34 
GeneralRe: Calling Unmanaged Class From DLL Pin
İsmail Durmaz5-Sep-09 5:37
İsmail Durmaz5-Sep-09 5:37 
GeneralRe: Calling Unmanaged Class From DLL Pin
«_Superman_»5-Sep-09 5:42
professional«_Superman_»5-Sep-09 5:42 
GeneralRe: Calling Unmanaged Class From DLL Pin
İsmail Durmaz5-Sep-09 5:43
İsmail Durmaz5-Sep-09 5:43 
GeneralRe: Calling Unmanaged Class From DLL Pin
Joe Woodbury5-Sep-09 8:39
professionalJoe Woodbury5-Sep-09 8:39 
AnswerRe: Calling Unmanaged Class From DLL Pin
Hristo-Bojilov5-Sep-09 7:55
Hristo-Bojilov5-Sep-09 7:55 
GeneralRe: Calling Unmanaged Class From DLL Pin
Joe Woodbury5-Sep-09 8:48
professionalJoe Woodbury5-Sep-09 8:48 
AnswerRe: Calling Unmanaged Class From DLL Pin
Joe Woodbury5-Sep-09 8:55
professionalJoe Woodbury5-Sep-09 8:55 
GeneralRe: Calling Unmanaged Class From DLL Pin
İsmail Durmaz6-Sep-09 3:12
İsmail Durmaz6-Sep-09 3:12 
GeneralRe: Calling Unmanaged Class From DLL Pin
Joe Woodbury6-Sep-09 7:36
professionalJoe Woodbury6-Sep-09 7:36 
QuestionSTL map in UNIX Pin
ashukasama4-Sep-09 23:24
ashukasama4-Sep-09 23:24 
I want to write shell programming in UNIX, alao i am new to unix. i have written very simple program for console

ISSUE:
I added some item in map as string int pair, now i am searching string read from commandline and i am unable to find it, but if i use same code with windows . i am able to do same.


Code is as follows

//Inclue files for libraries
#include <stdlib.h>
#include <ctype.h>
#include <iostream>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <ctime> 
#include <string>
#include <stdio.h>
#include <map>
#include <algorithm>

using namespace std;

map <string, int> m1;

int main(int argc, char* argv[])
{
	m1.insert(map <string, int> :: const_iterator::value_type("cd",0));		
	m1.insert(map <string, int> :: const_iterator::value_type("dir",0));		
	m1.insert(map <string, int> :: const_iterator::value_type("pwd",0));		
	m1.insert(map <string, int> :: const_iterator::value_type("echo",0));		
	m1.insert(map <string, int> :: const_iterator::value_type("help",0));		
	m1.insert(map <string, int> :: const_iterator::value_type("quit",0));		
	map <string, int> :: const_iterator m1_AcIter, m1_RcIter;
	typedef pair <string, int> Int_Pair;

	if(argc == 1)
	{
		cout<<"Please enter unix command..";
	}
	else
	{
		string command;
		command =  argv[1];            
		map <string, int> :: const_iterator m1_AcIter, m1_RcIter;
		m1_AcIter   = m1.find(command);
		if(m1_AcIter  == m1.end())
		{
			cout<<"Didn't find unix command - "<< command<<endl ;
		}
		else
		{ 
			system(command.c_str());
		}

	}
	
	map <string, int> :: iterator it;
	for ( it=m1.begin() ; it != m1.end(); it++ )
		cout << (*it).first << " => " << (*it).second << endl;
	
	return 0;

}


now i am running this code

./a.out ls

and i received following output

Didn't find unix command - ls<br />
cd =>; 0<br />
dir =>; 0<br />
echo =>; 0<br />
help =>; 0<br />
pwd =>; 0<br />
quit =>; 0 


but same code is working perfectly with windows.
AnswerRe: STL map in UNIX Pin
Richard MacCutchan4-Sep-09 23:36
mveRichard MacCutchan4-Sep-09 23:36 
GeneralRe: STL map in UNIX Pin
ashukasama4-Sep-09 23:53
ashukasama4-Sep-09 23:53 
GeneralRe: STL map in UNIX Pin
Stuart Dootson4-Sep-09 23:59
professionalStuart Dootson4-Sep-09 23:59 
GeneralRe: STL map in UNIX Pin
Stuart Dootson5-Sep-09 0:02
professionalStuart Dootson5-Sep-09 0: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.