Click here to Skip to main content
15,877,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionmaster file table Pin
mdocvc29-Jun-10 10:13
mdocvc29-Jun-10 10:13 
AnswerRe: master file table Pin
«_Superman_»29-Jun-10 15:11
professional«_Superman_»29-Jun-10 15:11 
GeneralRe: master file table Pin
mdocvc30-Jun-10 6:52
mdocvc30-Jun-10 6:52 
AnswerRe: master file table Pin
Member 419459329-Jun-10 16:08
Member 419459329-Jun-10 16:08 
QuestionPass Message to Window Procedure Pin
Fareed Rizkalla29-Jun-10 7:26
Fareed Rizkalla29-Jun-10 7:26 
AnswerRe: Pass Message to Window Procedure Pin
Rajesh R Subramanian29-Jun-10 7:30
professionalRajesh R Subramanian29-Jun-10 7:30 
AnswerRe: Pass Message to Window Procedure Pin
«_Superman_»29-Jun-10 15:16
professional«_Superman_»29-Jun-10 15:16 
Questionwhy segmentation fault ! Pin
wbgxx29-Jun-10 7:07
wbgxx29-Jun-10 7:07 
I want to swap two string


#include <stdio.h>
#include <string.h>
void swap(char *a1, char *a2)
{
	char ch[20];
	if (a1 != NULL || a2 != NULL)
		{
			strcpy(ch, a1);
			strcpy(a1, a2);
			strcpy(a2, ch);
			
		}
	else
		return ;
}

int main()
{
	char *a1 = "hello";
	char *a2 = "world";
	printf("Before the swap a1=%s, a2=%s", a1, a2);
	swap(a1, a2);
	printf("After the swap a1=%s, a2=%s", a1, a2);
	return 0;
}

AnswerRe: why segmentation fault ! Pin
Aescleal29-Jun-10 7:31
Aescleal29-Jun-10 7:31 
GeneralRe: why segmentation fault ! Pin
wbgxx29-Jun-10 7:38
wbgxx29-Jun-10 7:38 
GeneralRe: why segmentation fault ! Pin
Aescleal29-Jun-10 8:02
Aescleal29-Jun-10 8:02 
GeneralRe: why segmentation fault ! Pin
David Crow29-Jun-10 9:10
David Crow29-Jun-10 9:10 
GeneralRe: why segmentation fault ! Pin
Aescleal29-Jun-10 9:21
Aescleal29-Jun-10 9:21 
AnswerRe: why segmentation fault ! Pin
Fareed Rizkalla29-Jun-10 7:33
Fareed Rizkalla29-Jun-10 7:33 
AnswerRe: why segmentation fault ! Pin
Hristo-Bojilov29-Jun-10 7:42
Hristo-Bojilov29-Jun-10 7:42 
GeneralRe: why segmentation fault ! Pin
wbgxx29-Jun-10 7:46
wbgxx29-Jun-10 7:46 
GeneralRe: why segmentation fault ! Pin
Aescleal29-Jun-10 8:53
Aescleal29-Jun-10 8:53 
AnswerRe: why segmentation fault ! Pin
Niklas L29-Jun-10 8:37
Niklas L29-Jun-10 8:37 
QuestionSysListView32 help needed Pin
iceeeeman29-Jun-10 7:02
iceeeeman29-Jun-10 7:02 
QuestionRe: SysListView32 help needed Pin
David Crow29-Jun-10 7:16
David Crow29-Jun-10 7:16 
AnswerRe: SysListView32 help needed Pin
iceeeeman29-Jun-10 7:28
iceeeeman29-Jun-10 7:28 
GeneralRe: SysListView32 help needed Pin
Luc Pattyn29-Jun-10 7:50
sitebuilderLuc Pattyn29-Jun-10 7:50 
GeneralRe: SysListView32 help needed Pin
iceeeeman29-Jun-10 7:57
iceeeeman29-Jun-10 7:57 
QuestionRe: SysListView32 help needed Pin
David Crow29-Jun-10 8:02
David Crow29-Jun-10 8:02 
AnswerRe: SysListView32 help needed Pin
iceeeeman29-Jun-10 8:06
iceeeeman29-Jun-10 8:06 

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.