-2

This may seem really simple, but I don't know how to actually make a program that tells me this.

Nimantha
  • 6,405
  • 6
  • 28
  • 69

2 Answers2

2

As stated in comments, new will always give you a pointer.

But as new implies delete, I strongly advise you to take a look at a concept call RAII, especially why it's so popular.

X99
  • 905
  • 10
  • 24
1

Does "new CLASS" return CLASS or CLASS*

It returns a pointer to the type of the object that you're trying to allocate.

From new expression:

The new expression attempts to allocate storage and then attempts to construct and initialize either a single unnamed object, or an unnamed array of objects in the allocated storage. The new-expression returns a prvalue pointer to the constructed object or, if an array of objects was constructed, a pointer to the initial element of the array.

Jason
  • 36,170
  • 5
  • 26
  • 60