Click here to Skip to main content
14,383,511 members

C / C++ / MFC

 
QuestionReading files... Pin
Jacob Dixon20-Jan-10 17:25
memberJacob Dixon20-Jan-10 17:25 
AnswerRe: Reading files... Pin
Jacob Dixon20-Jan-10 17:37
memberJacob Dixon20-Jan-10 17:37 
AnswerRe: Reading files... Pin
Avi Berger20-Jan-10 17:48
memberAvi Berger20-Jan-10 17:48 
GeneralRe: Reading files... Pin
Jacob Dixon20-Jan-10 17:54
memberJacob Dixon20-Jan-10 17:54 
GeneralRe: Reading files... Pin
Jacob Dixon20-Jan-10 18:00
memberJacob Dixon20-Jan-10 18:00 
GeneralRe: Reading files... Pin
Jacob Dixon20-Jan-10 18:02
memberJacob Dixon20-Jan-10 18:02 
GeneralRe: Reading files... Pin
Avi Berger20-Jan-10 18:16
memberAvi Berger20-Jan-10 18:16 
GeneralRe: Reading files... Pin
Jacob Dixon20-Jan-10 18:17
memberJacob Dixon20-Jan-10 18:17 
GeneralOT [modified] Pin
Avi Berger20-Jan-10 19:15
memberAvi Berger20-Jan-10 19:15 
QuestionRe: Reading files... Pin
David Crow20-Jan-10 18:03
memberDavid Crow20-Jan-10 18:03 
AnswerRe: Reading files... Pin
Jacob Dixon20-Jan-10 18:11
memberJacob Dixon20-Jan-10 18:11 
QuestionSpin control: how does it works, specially when it changes acceleration ? Pin
timbk20-Jan-10 14:40
membertimbk20-Jan-10 14:40 
Questionconcat two char * variables Pin
santhosh-padamatinti20-Jan-10 7:13
membersanthosh-padamatinti20-Jan-10 7:13 
AnswerRe: concat two char * variables Pin
Rajesh R Subramanian20-Jan-10 7:26
professionalRajesh R Subramanian20-Jan-10 7:26 
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 

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.