Click here to Skip to main content
15,915,083 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can Create Shortcut key? Pin
Anu_Bala5-Aug-08 23:42
Anu_Bala5-Aug-08 23:42 
GeneralRe: How can Create Shortcut key? Pin
Le@rner6-Aug-08 18:21
Le@rner6-Aug-08 18:21 
AnswerRe: How can Create Shortcut key? Pin
Perspx6-Aug-08 13:35
Perspx6-Aug-08 13:35 
GeneralRe: How can Create Shortcut key? Pin
Le@rner6-Aug-08 18:45
Le@rner6-Aug-08 18:45 
GeneralRe: How can Create Shortcut key? Pin
Perspx6-Aug-08 23:04
Perspx6-Aug-08 23:04 
QuestionEfficient way to reverse the string inplace in c++?? Pin
Super Hornet5-Aug-08 22:05
Super Hornet5-Aug-08 22:05 
AnswerRe: Efficient way to reverse the string inplace in c++?? Pin
toxcct5-Aug-08 22:25
toxcct5-Aug-08 22:25 
GeneralRe: Efficient way to reverse the string inplace in c++?? Pin
Super Hornet5-Aug-08 22:49
Super Hornet5-Aug-08 22:49 
//function that retuens the reverse of passed string
char *ReverseString(char *pszString)
{
	if (pszString) //check for valid pointer
	{
		int ilength = strlen(pszString) + 1; //length of string including '\0'
	
		for (int iIndex = ilength; iIndex > 0; iIndex--)
		{
			pszString[i] = pszString[i-1];  
		}

		pszString[0] = '\0';
      
		return &pszString[ilength];
	}
	else
	{
		return NULL;
	}
}


//program to reverse the string inplace

int main()
{
	char szString[] = "hello world";
	
	//prints the string before calling ReverseString method
	cout << "String before reversing " << szString;
 
	szString = ReverseString(szStirng); //returns the reverse of a string

	//prints the string after calling ReverseString method
	cout << "\n String after reversing " << szString;
}



Is the above code correct???
GeneralRe: Efficient way to reverse the string inplace in c++?? [modified] Pin
toxcct5-Aug-08 23:02
toxcct5-Aug-08 23:02 
GeneralRe: Efficient way to reverse the string inplace in c++?? Pin
Jijo.Raj5-Aug-08 23:15
Jijo.Raj5-Aug-08 23:15 
GeneralRe: Efficient way to reverse the string inplace in c++?? Pin
toxcct5-Aug-08 23:17
toxcct5-Aug-08 23:17 
JokeRe: Efficient way to reverse the string inplace in c++?? Pin
Jijo.Raj5-Aug-08 23:21
Jijo.Raj5-Aug-08 23:21 
GeneralRe: Efficient way to reverse the string inplace in c++?? Pin
Naveen5-Aug-08 23:16
Naveen5-Aug-08 23:16 
GeneralRe: Efficient way to reverse the string inplace in c++?? Pin
toxcct5-Aug-08 23:17
toxcct5-Aug-08 23:17 
GeneralRe: Efficient way to reverse the string inplace in c++?? Pin
Naveen5-Aug-08 23:20
Naveen5-Aug-08 23:20 
GeneralRe: Efficient way to reverse the string inplace in c++?? Pin
Super Hornet6-Aug-08 3:42
Super Hornet6-Aug-08 3:42 
GeneralRe: Efficient way to reverse the string inplace in c++?? Pin
David Crow6-Aug-08 7:08
David Crow6-Aug-08 7:08 
QuestionCListCtrl Pin
john56325-Aug-08 21:43
john56325-Aug-08 21:43 
AnswerRe: CListCtrl Pin
Hamid_RT5-Aug-08 22:02
Hamid_RT5-Aug-08 22:02 
AnswerRe: CListCtrl Pin
_AnsHUMAN_ 5-Aug-08 22:04
_AnsHUMAN_ 5-Aug-08 22:04 
QuestionChecking internet connection is present or not... Pin
VCProgrammer5-Aug-08 21:42
VCProgrammer5-Aug-08 21:42 
AnswerRe: Checking internet connection is present or not... Pin
Jijo.Raj5-Aug-08 22:02
Jijo.Raj5-Aug-08 22:02 
GeneralRe: Checking internet connection is present or not... Pin
VCProgrammer5-Aug-08 22:16
VCProgrammer5-Aug-08 22:16 
GeneralRe: Checking internet connection is present or not... Pin
Jijo.Raj5-Aug-08 22:23
Jijo.Raj5-Aug-08 22:23 
GeneralRe: Checking internet connection is present or not... Pin
VCProgrammer5-Aug-08 23:12
VCProgrammer5-Aug-08 23:12 

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.