By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,332 Members | 1,414 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,332 IT Pros & Developers. It's quick & easy.

new foo -vs- new foo()

P: n/a
Given:
class foo { };

What is the difference between:

new foo

and

new foo()

?

When would I use the first form, when would I use the second form, and
why are there two different forms for what is apparently the same
thing?

Thanks,

Robert Schwartz
Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Robert Allan Schwartz" <no****@tessellation.com> wrote in message news:11**************************@posting.google.c om...
Given:
class foo { };

What is the difference between:

new foo

and

new foo()

?

When would I use the first form, when would I use the second form, and
why are there two different forms for what is apparently the same
thing?

Thanks,

Robert Schwartz


See the thread titled "new X vs new X() "
at http://groups.google.com/groups?thre...ing.google.com
\
--
Alex Vinokur
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn

Jul 22 '05 #2

P: n/a


See the thread titled "new X vs new X() "
at http://groups.google.com/groups?thre...ing.google.com


Maybe this is also useful:

http://www.parashift.com/c++-faq-lit....html#faq-26.7
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.