linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* typecasting - explain
@ 2005-09-09 19:46 _z33
  2005-09-09  7:33 ` kaushal
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: _z33 @ 2005-09-09 19:46 UTC (permalink / raw)
  To: linux-c-programming

   I'm not able to understand what exactly happens when I typecast a 
data type from one to other. What I had in mind was, that by typecasting 
you are making it clear to the compiler how to handle the data. For 
example, when you get a "void *" from malloc, the reason you typecast it 
to the required data type, is to make sure later the compiler doesn't 
complain or throw an error, when doing some pointer arithmetic on it. Am 
I wrong completely?
   If my conception is correct, then I'm having a serious problem in 
understanding typecasting of function pointers. First of all, I thought 
it is meaningless and the compiler won't allow it. However, to my shock 
I came across a posting today morning on a different newsgroup, claiming 
that it is in fact supported by the ANSI standard. Is it? If so, what 
does such a typecasting mean?

_z33
-- 
I love TUX; well... that's an understatement :)


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2005-09-09 19:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-09 19:46 typecasting - explain _z33
2005-09-09  7:33 ` kaushal
2005-09-09  8:48   ` _z33
2005-09-09  9:28     ` Jarmo
2005-09-09 10:04       ` _z33
2005-09-09 13:19         ` Glynn Clements
2005-09-09  9:46 ` Steve Graegert
2005-09-09 10:22   ` _z33
2005-09-09 10:49     ` Steve Graegert
2005-09-09 11:10       ` _z33
2005-09-09 11:29         ` Steve Graegert
2005-09-09 13:17 ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).