Bah. that's right. He'll just need to add another variable in there, that's all. ;)
It's 1pm, it's TO early to think!!! :p Rheede ----- Original Message ----- From: "Steve Boleware" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Thursday, April 17, 2003 12:17 PM Subject: Re: String Manipulation > Tisk, Tisk. Are you broken Rheede? > > What happens to the string if you do that.. colors are like so: ~1. Now > instead > of ~1 you have &- .. where'd the color code go? see the problem? > > For your problem Robin I would look at the way that the color codes are > replaced > with the ASCII code that actually is the color, you will have to do > something like that > to make this work.. Think also of the bother of making your read code handle > 2 chars > instead of direct replacement of - for ~ or how ever it does it now.. this > is not > an insanely hard thing to do but deeper than Reede's reply seems to indicate > :) > > ^_^ have fun guys.. > > Steve, coding from home on the fly, "look ma, no brains" > > > > > I would like to change the following function to replace the tilde > letter > > to > > > the two letters "&-" which is my color code for the tilde letter. Right > > now > > > it can only replace the letter with another letter. What what I do to > this > > > function to be able to replace the tilde letter with two letters? I'm > new > > to > > > string manipulation. =P > > > > > > void smash_tilde( const char *str ) > > > { > > > for ( ; *str != '\0'; str++ ) > > > { > > > if (*str == '~') > > > *(char *) str = '&'; > > *(char *) ++str = '-'; <----Basically you move forward down > the > > string > > and add the extra > > character. No too hard. :) > > > } > > > return; > > > } > > > > Happy coding, > > Rheede > > > -- > ROM mailing list > [email protected] > http://www.rom.org/cgi-bin/mailman/listinfo/rom

