Click here to Skip to main content
14,384,911 members

C / C++ / MFC

 
GeneralRe: concat two char * variables Pin
santhosh-padamatinti20-Jan-10 7:33
membersanthosh-padamatinti20-Jan-10 7:33 
GeneralRe: concat two char * variables Pin
Fatbuddha 120-Jan-10 7:46
memberFatbuddha 120-Jan-10 7:46 
QuestionRe: concat two char * variables Pin
CPallini20-Jan-10 11:47
mveCPallini20-Jan-10 11:47 
AnswerRe: concat two char * variables Pin
Luc Pattyn20-Jan-10 12:18
professionalLuc Pattyn20-Jan-10 12:18 
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
protectorRichard 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
protectorRichard 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
protectorRichard 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
protectorRichard 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
protectorRichard 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
protectorRichard 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 

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.