All pastes #765841 Raw Edit

Jc2k

public c v1 · immutable
·published 2007-11-08 12:13 UTC
rendered paste body
char* hardmystringcat(char *a, char *b){		/* Initialise some vars, pointers,etc */	char tmp[160];							//make a blank array to store the joined strings in	char *c;							//make a pointe to return	c = &tmp[0];							//make c point to the adress of tmp[0]	int i=0;							//used to reference the array index		/*load up array with what A is pointing to first */	while (*a != '\0'){		tmp[i] = *a;					  	//dump a's contents to the index of tmp		a++;							//increment pointer to next char in string 		i++;							//increment index value	}    /* load up array with what B is pointing to now */	while (*b != '\0'){		tmp[i] = *b;						//i should allready be at the end of A's length in the array tmp drop 						b++;							//increment pointer to next char in string		i++;							//increment index value	}	tmp[i+1] = '\0';						//add the end of the string onto the loaded array	return c;							//allready points to tmp[0]}