1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C++ -Reply me quickly

Discussion in 'C++' started by Dayanandkesarkar, Jul 11, 2010.

  1. Dayanandkesarkar

    Dayanandkesarkar New Member

    Joined:
    Jul 11, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    IN following optins which is true statement about prototype declaration in C++?
    1. void fun1(int,float);
    2. void fun1(int a,float b);
    3. void fun1(int a,float b=30.34);
    4.void fun1(int a=10,float b);
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    There are more than one true answers.
     
  3. bluecoder

    bluecoder New Member

    Joined:
    Mar 11, 2010
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    All are true .. :)
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    Last one cannot be true as default parameters cannot be only on the first param but you have to specify it for all the subsequent params
     
  5. bluecoder

    bluecoder New Member

    Joined:
    Mar 11, 2010
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    Yes ..u are right ... last one is false .. sorry i did not had proper look .
     

Share This Page