From essays to dissertations, we have experts for all of your assignments!

dot
  • 1.provide your instructions
  • 2.choose an expert in your field
  • 3.track the order progress

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