Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between A aaa; and A aaa();

class A{
    private:
        string a;
    public:
        A():a("hello world"){};
        A(const string & arg):a(arg){};
        void put()const{cout<<a;};
};

A aaa();
A bbb;

So what's the difference between A aaa(); and A bbb; Is aaa a function?

like image 713
bitstore Avatar asked Feb 24 '12 03:02

bitstore


People also ask

Is there A difference between AAA batteries?

AAA batteries differ greatly in chemistry and hence they differ in capacity, voltage, current/voltage discharging characteristics, and many other features, which may be of great importance when powering sensitive electronic equipment.

Whats the difference between AA2 and AA4?

What Is The Difference Between An Aa2 And Aa4 Battery? The AA4 is a newer battery, and thus has a higher capacity than the AA2. The AA2 is still a good battery, but it just doesn't have the same capacity as the AA4.

Which one is bigger AA or AAA?

AA batteries feature physical dimensions of 14.5 x 50.5 mm, while AAA batteries feature physical dimensions of 10.5 x 44.5 mm. Because of a larger volume of AA batteries, AA batteries generally feature a larger capacity and are able to provide stronger discharge currents.

Is AAA battery same as aaa4?

Please try again later. AAAA are the next size smaller than AAA. They are not interchangeable. I've yet to purchase any item that uses AAAA.


1 Answers

Yes, the first one is interpreted as a function declaration. It's been called the Most Vexing Parse.

like image 96
Mark Ransom Avatar answered Sep 18 '22 01:09

Mark Ransom