0
Question about reference
this is my code int a=1; int& p=a; in this situation that use only 1 memory space , but it have two variable name(a & p) is it right? sorry my poor english
3 Answers
+ 1
your statement technically isn't right, but I see why you think that. it is true that is you call the memory location or p (&p) and memory location of a (&a) it should both say something like 0x0f08a72. however when we access RAM we're not accessing the physical location of our variables but the virtually allocated location. So the physical location of p and a might be on completely separate sticks but virtually they're the same.
- 1
äøå½äŗŗåļ¼ę±čÆčÆ“äøäøä½ ēé®é¢ļ¼ļ¼ä¹č®øęč½č§£ēļ¼ļ¼ļ¼my english is poor too,
- 1
thts chinese and not english r u being sarcastic or what?