B
bharath.donnipad
Hi all,
I was going through a code at some site. Here is the code snippet in
whcih I have doubt:
#include <iostream.h>
#include <stdlib.h>
void fun (int);
int main()
{
int i =100;
fun(i);
return 0;
}
void fun (int =10)
{
}
I compiled this program and it compiled very well. What I dont
understand here is formal pameter list of function "fun" - "int =10".
Is this acceptible in C or C++? WHat does int = 10 mean? First time I
came across such statement. Can anyone please explain?
I was going through a code at some site. Here is the code snippet in
whcih I have doubt:
#include <iostream.h>
#include <stdlib.h>
void fun (int);
int main()
{
int i =100;
fun(i);
return 0;
}
void fun (int =10)
{
}
I compiled this program and it compiled very well. What I dont
understand here is formal pameter list of function "fun" - "int =10".
Is this acceptible in C or C++? WHat does int = 10 mean? First time I
came across such statement. Can anyone please explain?