JOIN
Get Time
forums  Revision History
Search My Post History  |  My Watches  |  User Settings
Forums Round Tables General Career Discussions Re: Foiled by a Div2-250! Revision History (3 edits)
Re: Foiled by a Div2-250! (response to post by d000hg)
I'll have go a seeing as I have been a bit picky on everyone else!. Untested so probably incorrect!!


void Func(char *str, int length) {
 
	int last = 0;
 
	for (int i = 0; i <= length; ++i) 
 
		if ( *(str + last) != *(str + i))
			*(str + (++last)) = *(str + i); 
	
	*(str + (++last)) = '\0';
 
}
Re: Foiled by a Div2-250! (response to post by d000hg)
I'll have go a seeing as I have been a bit picky on everyone else!.


void Func(char *str, int length) {
 
	int last = 0;
 
	for (int i = 0; i <= length; ++i) 
 
		if ( *(str + last) != *(str + i))
			*(str + (++last)) = *(str + i); 
	
	*(str + (++last)) = '\0';
 
}
Re: Foiled by a Div2-250! (response to post by d000hg)
I'll have a seeing as I have been a bit picky on everyone else!.


void Func(char *str, int length) {
 
	int last = 0;
 
	for (int i = 0; *(str + i) != '\0'; ++i) 
 
		if ( *(str + last) != *(str + i))
			*(str + (++last)) = *(str + i); 
	
	*(str + (++last)) = '\0';
 
}
Re: Foiled by a Div2-250! (response to post by d000hg)
I'll have a go ..... untested. [cpp]
void Func(char *str, int length) {

int last = 0;

for (int i = 0; *(str + i) != '\0'; ++i)

if ( *(str + last) != *(str + i))
*(str + (++last)) = *(str + i);

*(str + (++last)) = '\0';

}
[\cpp]