Re: printf("%d",float)
andreyvul <andrey....@xxxxxxxxx> wrote:
Pointer casting does not convert values of one type
to another.
Yes it does. Indeed, all conversions do precisely that.
Casting a pointer from one type to another converts the
pointer value from the original pointer type to a pointer
value of the cast type. Only certain conversions (and
chains thereof) are guaranteed to be lossless.
What you meant to say is that converting pointers does
not convert the value of the object being pointed to,
if any.
--
Peter
.
Relevant Pages
- Re: Is this valid C statement?
... > Where does the standard say that a conversion between a function ... > pointer and an object pointer, even with an explicit cast, is allowed? ... C99 6.3.2.3 enumerates a number of kinds of conversions that are ... I've tried the following program with several C compilers: ... (comp.lang.c) - Re: Please help me to clarify the invalid values of unary operator *
... Conversions from another pointer type that could otherwise create ... Do you mean the conversion itself has undefined behavior? ... the anti-aliasing rules listed in 6.5p6, so it seems redundant to list ... (comp.std.c) - Re: Is this valid C statement?
... >>Where does the standard say that a conversion between a function ... >>pointer and an object pointer, even with an explicit cast, is allowed? ... So if it's a case of undefined behavior, then it's "allowed", in the ... C99 6.3.2.3 specifies what pointer conversions are ... (comp.lang.c) - Re: K&R2 , exercise 7.6
... tightly restricted than casts (explicit conversions). ... and let the compiler generate the conversion for you. ... If you get the type right, the cast is harmless and completely ... NULL is a macro that expands to a null pointer constant. ... (comp.lang.c) - Re: [ANN] CplusRuby - Gluing C and Ruby
... I can see that it would be more of a necessity than a convenience if the function needed to be called from C as well as ruby. ... In a cshadow struct, this struct member doesn't exist, but there is reference back to the original object, on which you can call methods (with the additional friction of type conversions, if the caller is native C code). ... The fact that you have pointers to functions that accept C-typed args makes access from C easy and efficient, but it also uses a lot of space in the struct with a pointer to each function that implements a method. ... (comp.lang.ruby) |
|