Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. // Circle.cpp
  2. //
  3. // CompSci 141 / CSE 141 / Informatics 101 Fall 2009
  4. // Assignment #4
  5. //
  6. // I've included the definition of the Circle_new function, since you haven't
  7. // seen any examples of it. Other than that, you'll need to fill in the bodies
  8. // of the remaining functions.
  9.  
  10. #include "Circle.h"
  11.  
  12.  
  13. void** vmtCircle;
  14.  
  15.  
  16. // You shouldn't need to modify this function at all. It creates a new
  17. // Circle "object," calls the Circle constructor on it, then initializes
  18. // the vmt field of the newly-created Circle. You may be wondering why
  19. // the vmt field is being initialized here and not in the Circle
  20. // constructor. The reason is because it should only be initialized
  21. // once, but multiple constructors may be called (e.g. Square's constructor
  22. // will call Rectangle's, which will call Shape's) during the initialization
  23. // of an object.
  24. Circle* Circle_new(double positionX, double positionY, double radius)
  25. {
  26. Circle* c = new Circle;
  27. Circle_Circle(c, positionX, positionY, radius);
  28. c->vmt = vmtCircle;
  29. return c;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement