Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > new foo -vs- new foo()

Reply
Thread Tools

new foo -vs- new foo()

 
 
Robert Allan Schwartz
Guest
Posts: n/a
 
      08-11-2004
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
 
Reply With Quote
 
 
 
 
Alex Vinokur
Guest
Posts: n/a
 
      08-11-2004

"Robert Allan Schwartz" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) 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



 
Reply With Quote
 
 
 
 
marbac
Guest
Posts: n/a
 
      08-12-2004

>
>
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between Foo = Class.new and class Foo Brandon Dimcheff Ruby 2 10-07-2008 03:16 PM
vector: Foo[5] == ((foo*)Foo) + 5 ? .rhavin grobert C++ 4 09-24-2008 01:57 PM
Using new foo where foo is a new Foo object. blackholebutterfly@gmail.com Javascript 4 12-23-2007 10:45 PM
new String( "foo" ) VS. "foo" dhtmlkitchen@gmail.com Javascript 1 07-12-2007 08:32 PM
why functions in modules need 'global foo' for integer foo but not dictionary foo? seberino@spawar.navy.mil Python 3 07-29-2005 12:42 PM



Advertisments