Usetutoringspotscode to get 8% OFF on your first order!

  • time icon24/7 online - support@tutoringspots.com
  • phone icon1-316-444-1378 or 44-141-628-6690
  • login iconLogin

C++ Pointers Lab

Create two triangle classes, one where the internal properties are stored on the stack and one where the internal properties are stored on the heap.  Each triangle should have a base, height, and a function that returns the area.

Triangles 1:  Create a vector of triangles where everything is stored on the stack. 

Triangles 2: Create a vector of triangles where everything is stored on the heap.

Triangles 3:  Create a vector where the items in the vector are stored on the stack, but the individual items have some data on the heap.

Triangles 4: Create a vector where the items in the vector are stored on the heap, but the individual items use no dynamic memory.

Note:  Think about what version of the triangle you should use for each scenario and make sure you do not have any memory leaks.

You can leave a response, or trackback from your own site.

Leave a Reply

Powered by WordPress | Designed by: Premium WordPress Themes | Thanks to Themes Gallery, Bromoney and Wordpress Themes