Can i call a function using new in c++? -
i want know suppose have function say
int add(int i, int j) { return (i+j); } at point can call function using new like
int result = new add(3,4); thanks in advance.
new returns pointer dynamically allocated object. syntax of form new t(optional initializer expression). need
int* result = new int(add(3,4));
Comments
Post a Comment