Jump to content
  • Advertisement
Sign in to follow this  
3dcgmodeling

tip for share.

This topic is 4171 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I FOUND there 3 kinds of () usage in c++. class() object() function(); it is a little ambiguity. list here for in focus. class() call constructor; object() call () operator function() ordinary function call.

Share this post


Link to post
Share on other sites
Advertisement
he's not asking a question, he's sharing the results of his research into what () does in C++

Share this post


Link to post
Share on other sites
Quote:
Original post by ToohrVyk
You forgot one.

A B(); is a declaration.



hrhr^^



@3dcgmodeling: it`s just a matter of proper naming to keep them seperated


Share this post


Link to post
Share on other sites
Quote:
Original post by 3dcgmodeling
class() call constructor;


A constructor is a function that creates an object.

Quote:
Original post by 3dcgmodeling
object() call () operator


That's overloaded if the object is a functor, that is, it's acting as a function.

Quote:
Original post by 3dcgmodeling
function() ordinary function call.


Self explanatory. So they're all just variations on the idea of a function.

Share this post


Link to post
Share on other sites
Hey, dont diss the kid for sharing what he noticed.

Though 3dcgmodeling, if I were you I would work on your explination a little bit to make it a bit more readable to the average joe. The way you wrote it i'm thinking only those that already understand will get what your talking about.

For those that are dissing 3dcgmodeling here, he is refering to the use of the automated overloading of the () operator.

A better way at looking at the constructor is that each class is also a function. The classes function is the constuctor, which creates and initializes the class.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!