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

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -