Basic question on Pointers!!
-
Hi, Whenever a pointer is not allocated, something like this, CClass *myObj; It is pointing to some address like 0xccddff. I know that the address is junk. Why it is always like 0xccdeff or 0xdeffcc?? Why it is not like 0x102033?? So, before allocation of memory it is pointing to some place, which is junk. But, where is that junk area? or which is the area used where the not allocated pointer points to? Best Regards, A.Ilamparithi
-
Hi, Whenever a pointer is not allocated, something like this, CClass *myObj; It is pointing to some address like 0xccddff. I know that the address is junk. Why it is always like 0xccdeff or 0xdeffcc?? Why it is not like 0x102033?? So, before allocation of memory it is pointing to some place, which is junk. But, where is that junk area? or which is the area used where the not allocated pointer points to? Best Regards, A.Ilamparithi
-
Hi, Whenever a pointer is not allocated, something like this, CClass *myObj; It is pointing to some address like 0xccddff. I know that the address is junk. Why it is always like 0xccdeff or 0xdeffcc?? Why it is not like 0x102033?? So, before allocation of memory it is pointing to some place, which is junk. But, where is that junk area? or which is the area used where the not allocated pointer points to? Best Regards, A.Ilamparithi
The compiler sets this up for you (in debug builds only) so that you can find bugs quickly if you accidentally use the pointer without initializing it. It also does a similar thing with dynamically allocated blocks of memory.
Lets be honest, isn't it amazing how many truly stupid people you meet during the course of the day. Carry around a pad and pencil, you'll have twenty or thirty names by the end of the day - George Carlin Awasu 1.1.4 [^]: A free RSS reader with support for Code Project.