cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Why we have pointers with diffrent types
Why we have pointers with diffrent types
Dec 15, 2010 at 11:45am UTC
ajitm
(52)
Hi
I am very Igor to know why we have different types of pointer as we can use Void pointer for all data types. Then what the reason to have pointes with diff data type as each requires(4 bytes).
Dec 15, 2010 at 12:07pm UTC
coder777
(8450)
Type safety
Dec 15, 2010 at 12:26pm UTC
Bazzy
(6281)
When you dereference a pointer, you must know the type it's pointing to.
Dec 15, 2010 at 12:28pm UTC
kbw
(9488)
Also, pointer arithmetic doesn't work if you don't know the size of the item pointed to.
Topic archived. No new replies allowed.