Re: strcpy and strcat's return type
- From: "Jirka Klaue" <jklaue@xxxxxxxxxxxxxxxx>
- Date: Tue, 26 Jul 2005 15:39:16 +0200
Lew Pitcher:
zeroDontSpamtype@xxxxxxxxx:....
Why do strcpy and strcat (and strupr and strlwr in some nonstandard implementations) return a char*? Surely the logical (and DMA-safe) )return type for these would have been void??
Why should strcat() return a void *, when both of it's arguments are char *, and the function is defined as working on character strings?
He said void, not void *. And to answer the actual question: I think, they return char * to allow such things as
return strcat(strcpy(buf, path), file);
Jirka .
- Follow-Ups:
- Re: strcpy and strcat's return type
- From: Kenneth Brody
- Re: strcpy and strcat's return type
- References:
- strcpy and strcat's return type
- From: zeroDontSpamtype
- Re: strcpy and strcat's return type
- From: Lew Pitcher
- strcpy and strcat's return type
- Prev by Date: Re: Should function argument be changed in function body?
- Next by Date: Re: question about random generator
- Previous by thread: Re: strcpy and strcat's return type
- Next by thread: Re: strcpy and strcat's return type
- Index(es):
Relevant Pages
|