خرید بک لینک

Vote count: 0

I have defined this class:

class numbers
{
    private:
        int i{ 0 };
        int j{ 0 };

    public:

        int get_i() const;
        int get_j() const;
        void set_numbers(int, int);
        numbers(int x, int y);
        numbers();
};

Now in the int main(void) what is the difference between the following statements:

numbers numberA;
numbers numberA ();
numbers numberA {};
numbers numberA (10,20);
numbers numberA {10,20};

Basically I am confused between the use of () empty or otherwise vs {} empty of otherwise. Both of them seem to give same result, but with programming languages things usually have very specific meanings thus this question.

I notice that using numberA (10,20); causes 2 calls to initializer than numberA {10,20};

asked 14 secs ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 18 تير 1395 ساعت: 9:07

صفحه بندی