|
-
Nov 21st, 2002, 07:38 PM
#1
Thread Starter
Addicted Member
the dot and ->
I have an array of objects on the free store
Obj *myObj = new Obj[10];
when i want to access these (compiler:MSVC++), i have to say myObj[x].whatever
but if i do just one object on the free store:
Obj *myObj = new Obj;
i must say myObj->whatever
If they are both pointers, why do i have to use the dot for one and the -> for the other?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|