Initializing dynamic array pointer of Type T
May 22, 2017 at 10:40pm
How to initialize dynamic array pointer of Type T
Example
1 2
|
//How to initialize this
Type *t = new Type[some_value]
|
Or how to set all to NULL
May 22, 2017 at 11:01pm
Last edited on May 22, 2017 at 11:02pm
May 22, 2017 at 11:43pm
So, can I check if t[index] == NULL??
May 23, 2017 at 6:39am
Yes. Pointers are value-initialized to null.
Topic archived. No new replies allowed.