Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have read various documentations on the new data types.But each time one question keeps hanging in my mind. Are the new data types pointers?Every documentation that discusses them always make mention of pointers and pointer arithmetic.

The answer to the following questions will help me comprehend these new data types fully.

1. Can one declare : INT_PTR *, UINT_PTR * etc?

2.Is. int * quivalent to. INT_PTR,
DWORD * equivalent to DWORD_PTR, etc?


In short are these new data tyes pointer equivalent of the old data types.If no, what is the pointer relationship between these new data types and the corresponding old data types?

Thank you.
Posted

1 solution

it is basic knowledge.

1. INT_PTR* is a pointer to an INT_PTR
2. not really, because a INT_PTR resolves to an int64* on x64

If you want to do pointer arithmetics and 64-portable code you need to deeply understand the differences.

further reading: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx[^]
 
Share this answer
 
Comments
Gbenbam 18-Feb-14 7:26am    
Thanks.Your reaponse cleared a lot of confusion.
KarstenK 18-Feb-14 7:31am    
Fine. Take care on pointer arithmetics ;-)
Gbenbam 18-Feb-14 7:54am    
Well.Talking about pointer arithmetic,I have come to the following decisions.I just hope they are right.

1.Use the normal 32bit data types but use the _PTR equivalent whenever there will be need to cast or when I will need to declare pointer to the data type concerned.

By the way, isn't it better for me to stick to strictly using only the _PTR equivalent?
KarstenK 18-Feb-14 8:08am    
I would prefer the _PTR syntax, to ensure 64-bit portability.
Gbenbam 18-Feb-14 8:16am    
Thanks a billion times.With this issue resolved I can now code much faster without entertaining any form of doubts and concern.Once again, thanks for lending me a hand.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900