Advertisement
Guest User

Untitled

a guest
Mar 17th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. entrant.cpp:28:41: error: request for member ‘get_id’ in ‘((Entrant*)this)->Entrant::course’, which is of pointer type ‘Course*’ (maybe you meant to use ‘->’ ?)
  2. ----
  3. Translation: On line 28 of entrant.cpp, position 41, you're using the dot operator to access an attribute (get_id) of a pointer (course in namespace Entrant). This is invalid. You have to use the arrow operator to de-reference the pointer and access the members of the thing it points to.
  4.  
  5. ie you're doing
  6. course.get_id; // valid Java.
  7. course->get_id; // valid C++
  8.  
  9. Does this help?
  10.  
  11. At the risk of starting a cargo cult, Hungarian Notation is useful for avoiding these kinds of errors.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement