Hi
This type of function overloading works in c .
Execute following code and it will call function fun as per the
function parameter
code snip-in
-
#includestdio.h
void fun(const char *p)
{
printf(funsfsdafsf1\n);
}
void fun(char *P)
{
printf(fun2\n);
}
void
Run this one:
#includestdio.h
void fun(const char *p)
{
printf(const\n);
}
void fun(char *P)
{
printf(simple\n);
}
int main(void)
{
char str[] = funcheck;
//const char str1[] =
constcheck;
fun(str);
fun(str);
}
On Tue, Nov 22, 2011 at 7:13 PM, MJ mayurdj...@gmail.com wrote:
Hi
What this means compiler looks for closest possible match ,then other
alternatives.In this func(char*) is executed if that is not there then
func(const char*) is executed.
Comment the func(char*) and check.There is no overloading in c as far i
know.
On Tue, Nov 22, 2011 at 10:11 PM, Jagannath