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

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

objective c - Ownership modifiers with manual reference counting -

python 3.x - Mapping specific letters onto a list of words -