Lightbulbstring eqaliser

Posts 1–7 of 7 · Page 1 of 1
string eqaliser
this thing takes 2 strings and eqalises the lentghs. so for example u take "foo" and "foobar" an itll make "foo000" and "foobar" .
is very hi tech .

enjoy, (c) me

Code:
void fixstrign(char*& lol,char*& hue) {
	//lengths for maximum efficiency of length
	int lollen=strlen(lol);
	int huelen=strlen(hue);
	
	if(lollen==huelen) return;
	bool swape=lollen<huelen; //swapemaster
	if(swape) {
		char* tmp=lol;lol=hue;hue=tmp;
		int tmp2=lollen;lollen=huelen;huelen=tmp2;
	}
	//<br>
	//is made a <br> above to add a line between the lines for to make a line taller

	char* newhue;
	newhue=new char[lollen];
	memcpy(newhue,hue,huelen);
	for(int i=huelen;i<lollen;++i)
		newhue[i]='0';
	hue=newhue;
	//<br>
	//more of this is <br>
	if(swape) {
		char* tmp=lol;
		lol=hue;
		hue=tmp;
	}
}
is of good code? of undetect this month?
yes, is of very good code .
I make fix of the memory so leak more
Code:
void fixstrign(char*& lol,char*& hue) {
	//lengths for maximum efficiency of length
	int lollen=strlen(lol);
	int huelen=strlen(hue);
	
	if(lollen==huelen) return;
	bool swape=lollen<huelen; //swapemaster
	if(swape) {
		char* tmp=lol;lol=hue;hue=tmp;
		int tmp2=lollen;lollen=huelen;huelen=tmp2;
	}
	//<br>
	//is made a <br> above to add a line between the lines for to make a line taller
        char* huehuehuehuehuheuhe = new char[500];
        //is of for to leaking the memory
	char* newhue;
	newhue=new char[lollen];
	memcpy(newhue,hue,huelen);
	for(int i=huelen;i<lollen;++i)
		newhue[i]='0';
	hue=newhue;
	//<br>
	//more of this is <br>
	if(swape) {
		char* tmp=lol;
		lol=hue;
		hue=tmp;
	}
}
that is a very bright codes . thakn u very much sir

maximises memry output

---------- Post added at 08:19 PM ---------- Previous post was at 08:11 PM ----------

Quote Originally Posted by J View Post
ohmygawd dis is da kewlist ting eye have ever seeeeen
tahnk u j. but wut do u meen wen u say ur a redhat hacker
ohmygawd dis is da kewlist ting eye have ever seeeeen
Code:
int main() {
	char* test1="foo";
	char* test2="foobar";
	
	fixstrign(test1,test2);
	cout<<test1<<endl;
	cout<<test2<<endl;
	
	return 0;
}
is esee 2 test

takes foo and triple zeros it to maximize strign eqelity


haha wen u uuse a long string it taeks the 0s and gose like
00000000000000
hhahahah
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?