Mail Archives: djgpp/1997/08/29/09:50:07
Erik Max Francis (max AT alcyone DOT com) writes:
> Vincent Collura wrote:
>
>> For those who dont know, mid$ returns the
>> n'th character to the nth number.
>>
>> What is the C++ function to do this? I have
>> tried StrnCat but the problem with this is you
>> cant specificy a starting location.
>
> There isn't a standard C function do to this for you. You're going to
> have to write your own.
void strncatat(char *dest, char *src, int startchr, int max) {
// Startchr is from 1 on upwards
int s2;
char *temp;
s2=startchr-1;
if (s2<0) s2=0; // Or it could print a message and die, or something.
temp=src+s2; // Character startchr of src.
strncat(dest,temp,max);
}
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -