So there is no difference between these two lines:
...other than preference or readability. *There is no technical reason I should use one over the other.Code:myclass->mymethod(); (*myclass).mymethod();
And I can treat this
...just like any other normal array.Code:... int *ptr; ... ptr= new int[size]; ...
Sorry about belaboring the point. *I just want to make sure I have this correct.
Yes, there's no difference at all, but the first one is preferred as there's less typing, but you can't do pointer arithmetic with the first one.So there is no difference between these two lines:
...other than preference or readability. There is no technical reason I should use one over the other.Code:myclass->mymethod(); (*myclass).mymethod();
Yep, you got it. Pointers can also be accessed as arrays.And I can treat this
...just like any other normal array.Code:... int *ptr; ... ptr= new int[size]; ...
Sorry about belaboring the point. I just want to make sure I have this correct.
Bookmarks