previous | start | next

Pointers and Memory Allocation (Syntax 10.1 new Expression)

Syntax 10.1 : new Expression

newtype_name
newtype_name(exprssion1,expression2, . . . ,expressionn)
Example:
new Time;
new Employee("Lin, Lisa", 68000)
Purpose: Allocate and construct a value on the heap and return a pointer to the value.


previous | start | next