954,479 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

in range strcpy

0
By Mathias Van Malderen on May 24th, 2009 2:36 am

Usage:: <strong>ir_strcpy</strong>( <em>destination</em>, <em>source</em>, <em>range_begin</em>, <em>range_end</em>); example:

char test[] = "Hello World!!!";
char test2[20];
ir_strcpy(test2, test, 1, 3); /* test2 now contains 'ell' */
/**
@author: Mathias Van Malderen (tux4life)
*/

void ir_strcpy( char *s1, const char *s2, int rb, int re )
{
    while( (rb <= re) && (*s1++ = s2[rb]) ) rb++;
    *s1 = 0;
}

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You