All this pointing is making me dizzy! :-S
bangz.
how do you make your pointers?
I say just typecast it! That way it doesn''t matter which way you declare it.
typecast int* ptrINT;
ptrINT ptr_v, ptr_y, p;
Problem solved. Order has been restored once again.
typecast int* ptrINT;
ptrINT ptr_v, ptr_y, p;
Problem solved. Order has been restored once again.
quote:Original post by Dino
I say just typecast it! That way it doesn''t matter which way you declare it.
I think you mean typedef.
quote:Original post by Anonymous Poster
I tend not to use const.. as I know whether or not I want it changed or not (and it''s ussually pretty obvious) and I''m pretty much the only one that see''s my code :D.
const correctness is a good habit to get into. Apart from the obvious issue of making your code usable for other people (which may not be an issue now, but may be later in your career) the compiler can make certain optimizations with const variables, leading to faster code.
I don''t know about you guys, but I like to do it like this:
The point is this: the compiler doesn''t give a fiddler''s damn, and the rest is just personal preference. So, please, Mr. moderator, close this stupid thread.
int * int_ptr;
The point is this: the compiler doesn''t give a fiddler''s damn, and the rest is just personal preference. So, please, Mr. moderator, close this stupid thread.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement