Results 1 to 7 of 7

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Aug:2012
    Location:
    Posts: 297

    , .
    limes :
    limes()
    {
    up = 3;
    down = 0;
    }

    limes( into x = 1, int y = 2)
    {
    up = x;
    down = y;
    }

    main- :
    limes func; limes func()
    ?
    func ?

  2. #2
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , 2 int . , . overloading.
    . , .

  3. #3
    Registered User
    Join Date: Aug:2012
    Location:
    Posts: 297
    . main- primerno:
    limes granica; , 2 x y , , 1 2. , limes granica , , 1 2. , default constructor . :
    limes(int x, int y = 2) limes granica; granica.up granica.down 0 3 , .
    , , ( ). , .
    limes granica; limes granica();
    , :
    limes granica , default constructor, , cout << granica.up, expression must have class type . ?

  4. #4
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    into x=1, int x=1 .
    .
    default , =1 , default constructor . default (Edit: , PHP) ( , " " ).
    ambiguity default constructors.
    ++ , , .
    Last edited by tedych; 30th December 2013 at 19:24.

  5. #5
    Registered User
    Join Date: Sep:2013
    Location: Bulgaria
    Posts: 59
    Quote Originally Posted by DuMBo0o View Post
    limes()
    {
    up = 3;
    down = 0;
    }

    limes( int x = 1, int y = 2)
    {
    up = x;
    down = y;
    }
    default main- , . 1 default- . limes func(); main , . default , default . :
    Code:
    ...
    limes(int x = 1, int y = 2); // -      
    limes(int x, int y, int z = 5); //- -,    
    limes(int x = 4, int y); // - default      .
    ...

  6. #6
    Registered User hateras's Avatar
    Join Date: Jan:2011
    Location: Kronos III
    Posts: 1,028
    limes granica;
    , .
    -, ... C++ , .
    ASRock B550M Pro 4; Ryzen R5 3600; 2x16 GiB G.SKILL Aegis 3200; 1TB Samsung QVO 960 + 3TB Seagate IronWolf; Zalman Z1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |