cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
How to correctly cast pointer to integer
How to correctly cast pointer to integer in C++
Apr 2, 2012 at 3:43pm UTC
Beju
(20)
Hi, I was just wondering if there's a C++ way to make unsigned integer from pointer to any type. The only way I found is the standard C-like cast. The system is 32-bit.
Last edited on
Apr 2, 2012 at 3:43pm UTC
Apr 2, 2012 at 3:48pm UTC
Athar
(4466)
Not sure why you want to do that, but you need to use reinterpret_cast for this.
Apr 2, 2012 at 4:52pm UTC
Beju
(20)
Thank you:) I thought that reinterpret_cast works only with pointers, but it seems it's working with integers also.
About your question, I just wanted to get a start address of an array of uint64_t.
Topic archived. No new replies allowed.