default value for parameters in gcc

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Hanzo

default value for parameters in gcc

Post by Hanzo »

Is there a way to give default values to parameters of a function in gcc (in djgpp)?

void fnc(int a, int b=0); <<--??

fnc(10); = fnc(10, 0);
fnc(20, 15);
anubis

Re:default value for parameters in gcc

Post by anubis »

Code: Select all

void func(int a,int b=0)
{
  //functions definition (functions code)
}
I think this will work.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:default value for parameters in gcc

Post by Pype.Clicker »

this is a c++ only feature, isn't it ?
Post Reply