Tuesday, August 6, 2013

Does standard say anything about pointer->int or int->ptr conversions?

Newsgroup: comp.lang.c++

Subject: Does standard say anything about pointer->int or int->ptr conversions?

From: Peter <pilarp@...>

Date: Mon, 5 Aug 2013 14:44:01 -0700 (PDT)



It's not that uncommon to see code where integral type is cast to a pointer or vice versa. On this page:



https://computing.llnl.gov/tutorials/pthreads/



you can see a few examples of casting void* to long, long to void* etc. Does standard address such conversions in any way other than calling them "undefined behaviour"? If not then why do people use them? Are they well defined for a particular compiler/hardware?







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?59018-Does-standard-say-anything-about-pointer-int-or-int-ptr-conversions&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

No comments:

Post a Comment