Page is a not externally linkable
- Code, Content, and Presentation
-- Perl Server Side CGI Scripting
---- string to int


wruppert - 4:08 am on Sep 15, 2007 (gmt 0)


Perl was invented to make this stuff easy. String manipulation in C is a pain. It has been a few years since I wrote any C, so I may have messed up the syntax a bit. I would have done something like this:


char* skip_colons (char* src, char* dest) {
char* s = src;
char* d = dest;

while (*s++) {
if (*s!= ':') {
*d++ = *s;
}
}
*d = '\0';

return dest;
}


Thread source:: http://www.webmasterworld.com/perl/3450702.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com