Click here to Skip to main content
14,391,048 members

C / C++ / MFC

 
GeneralRe: concat two char * variables Pin
CPallini20-Jan-10 12:23
mveCPallini20-Jan-10 12:23 
AnswerRe: concat two char * variables [modified] Pin
santhosh-padamatinti20-Jan-10 21:13
Membersanthosh-padamatinti20-Jan-10 21:13 
GeneralRe: concat two char * variables Pin
CPallini20-Jan-10 22:20
mveCPallini20-Jan-10 22:20 
GeneralRe: concat two char * variables Pin
Saravanan Sundaresan21-Jan-10 19:52
professionalSaravanan Sundaresan21-Jan-10 19:52 
Here is the function as per your requirement:

char* concat(const char* c1, const char* c2)
{
	int size1 = 0, size2 = 0;

	for (int i = 0; c1[i] != '\0'; i++)
		size1++;
	for (int j = 0; c2[j] != '\0'; j++)
		size2++;

	char* result = new char[size1+size2];

	for(int i=0; i<size1; i++)
	{
		result[i] = c1[i];
	}

	for(int j = 0; j <= size2; j++)
	{
		result[size1+j] = c2[j];
	}

	result[size1+size2] = 0;

	return result;
}

AnswerRe: concat two char * variables Pin
Avi Berger20-Jan-10 8:11
MemberAvi Berger20-Jan-10 8:11 
AnswerRe: concat two char * variables Pin
David Crow20-Jan-10 8:53
MemberDavid Crow20-Jan-10 8:53 
GeneralRe: concat two char * variables Pin
Richard MacCutchan20-Jan-10 12:50
mveRichard MacCutchan20-Jan-10 12:50 
GeneralRe: concat two char * variables Pin
Fatbuddha 120-Jan-10 21:13
MemberFatbuddha 120-Jan-10 21:13 
GeneralRe: concat two char * variables Pin
CPallini20-Jan-10 21:51
mveCPallini20-Jan-10 21:51 
GeneralRe: concat two char * variables Pin
Richard MacCutchan20-Jan-10 23:14
mveRichard MacCutchan20-Jan-10 23:14 
QuestionRe: concat two char * variables Pin
CPallini20-Jan-10 23:19
mveCPallini20-Jan-10 23:19 
AnswerRe: concat two char * variables Pin
Richard MacCutchan21-Jan-10 0:15
mveRichard MacCutchan21-Jan-10 0:15 
GeneralRe: concat two char * variables Pin
CPallini21-Jan-10 0:29
mveCPallini21-Jan-10 0:29 
GeneralRe: concat two char * variables Pin
Richard MacCutchan21-Jan-10 0:36
mveRichard MacCutchan21-Jan-10 0:36 
QuestionModal vs Modeless dialog box Pin
msr_codeproject20-Jan-10 7:05
Membermsr_codeproject20-Jan-10 7:05 
AnswerRe: Modal vs Modeless dialog box Pin
Richard MacCutchan20-Jan-10 7:08
mveRichard MacCutchan20-Jan-10 7:08 
AnswerRe: Modal vs Modeless dialog box Pin
Rajesh R Subramanian20-Jan-10 7:58
professionalRajesh R Subramanian20-Jan-10 7:58 
QuestionRaeding and parsing mails via POP3 Pin
VictorSotnikov20-Jan-10 5:52
MemberVictorSotnikov20-Jan-10 5:52 
AnswerRe: Raeding and parsing mails via POP3 Pin
Richard MacCutchan20-Jan-10 6:47
mveRichard MacCutchan20-Jan-10 6:47 
AnswerRe: Raeding and parsing mails via POP3 Pin
Joe Woodbury20-Jan-10 10:48
professionalJoe Woodbury20-Jan-10 10:48 
AnswerRe: Raeding and parsing mails via POP3 Pin
Rozis20-Jan-10 15:06
MemberRozis20-Jan-10 15:06 
Questionproblem with stack structure implementation in C, plz help !!! Pin
hung2h20-Jan-10 4:14
Memberhung2h20-Jan-10 4:14 
AnswerRe: problem with stack structure implementation in C, plz help !!! Pin
Richard MacCutchan20-Jan-10 4:38
mveRichard MacCutchan20-Jan-10 4:38 
GeneralRe: problem with stack structure implementation in C, plz help !!! Pin
hung2h20-Jan-10 4:52
Memberhung2h20-Jan-10 4:52 
GeneralRe: problem with stack structure implementation in C, plz help !!! Pin
hung2h20-Jan-10 5:07
Memberhung2h20-Jan-10 5:07 

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.