Re: what is typecasting a pointer to the type (void *)p mean?
- From: Michael Rasmussen <mir@xxxxxxxxx>
- Date: Wed, 25 Jan 2006 23:07:54 +0100
On Wed, 25 Jan 2006 22:56:57 +0100, Emmanuel Delahaye wrote:
>
> Somehow, yes. Note that the conversion from/to void* doesn't need an
> explicit typecast.
>
Well, not always but in this situation it is mandatory:
void foo(void *t) {
printf("%s", (char *) t);
}
int main() {
char *t = "test";
foo(t);
return 0;
}
So might as well use explicit casting since it is a lot more readable for
an outsider which later has to maintain the code. IMHO
--
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917
.
- Follow-Ups:
- Re: what is typecasting a pointer to the type (void *)p mean?
- From: Abhishek
- Re: what is typecasting a pointer to the type (void *)p mean?
- From: Al Balmer
- Re: what is typecasting a pointer to the type (void *)p mean?
- References:
- what is typecasting a pointer to the type (void *)p mean?
- From: Abhishek
- Re: what is typecasting a pointer to the type (void *)p mean?
- From: Michael Rasmussen
- Re: what is typecasting a pointer to the type (void *)p mean?
- From: Abhishek
- Re: what is typecasting a pointer to the type (void *)p mean?
- From: Emmanuel Delahaye
- what is typecasting a pointer to the type (void *)p mean?
- Prev by Date: Re: union arrangement
- Next by Date: Re: what is typecasting a pointer to the type (void *)p mean?
- Previous by thread: Re: what is typecasting a pointer to the type (void *)p mean?
- Next by thread: Re: what is typecasting a pointer to the type (void *)p mean?
- Index(es):
Relevant Pages
|