Quote Originally Posted by Salem
> The second one is lacking a cast but it is certainly not incorrect
If you want to ride rough-shod all over the type system then go ahead, but you'll get no help from the compiler (or anyone else) if you've used so many casts as to make any kind of diagnostics ineffective.
Why even have the ability to cast at all then, lets just take it out it is obviously useless.


Quote Originally Posted by Salem
> But it is not "wrong"
By that, you mean so long as it works on your current compiler, then it's just fine and dandy I suppose.
Surely you should know by now that the "works for me" defence is no argument on this board, just like other brainless ideas like "void main", "fflush(stdin)" and other atrocities.
No it was more, it works on every compiler I have ever used. Of course if you want to assume the OP was planning on running this on some bizarre system which didn't have pointers being the natural word size of the machine, like ints generally are, then you are right. There is a difference between strict adherence to the standard and reasonable adherence. You are correct if you are in the camp of "I never write a single line of code that doesn't adhere 100% to the ISO C standard", you are also probably not writing any interesting code, even threading isn't covered in the standard so lets not talk about it either, I mean who would ever want to do that.


Mezzano