Another Question to Pass my Time

Started by
3 comments, last by Andrew Nguyen 22 years, 2 months ago
What is the difference between aliases and pointers?
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---
Advertisement
An alias is a pointer that points to the same thing another pointer points to. Likewise with references

  int x;int& y(x);//y is an alias for x  
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
I asked for the difference, not rhetoric that means the same thing. (Or you can clarify...)
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---
It''s your question that is screwed Andrew, not the reply. Try looking up the word "Alias" in a dictionary, and you''ll see where you are wrong. Pointers are aliases to whatever you make them point to, so when your question doesn''t make much sense. Perhaps you mean "What is the difference between pointers and references?"? If so, there is a little search button to the top right of this forum, I''ve seen it discussed a few times before.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
A pointer is one way of implementing an alias. So is a reference. That''s all.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]

This topic is closed to new replies.

Advertisement