Prashant Mishra
Prashant Mishra

Reputation: 177

what do you understand by printf () function in respect of function overloading?

I know that when a class has multiple functions with the same name and different parameter list it is called function overloading.

But in case of printf() function, whenever we want to print values of different data types by using format specifiers like this as given below

printf("%c%d%f",a,b,c);  

can we say it is function overloading?

Upvotes: 0

Views: 69

Answers (2)

ouah
ouah

Reputation: 145899

There is no mechanism of function overloading in C.

With function overloading, you have different functions with the same name but with different signatures. printf is a variadic function (it accepts a variable number of arguments) and it has a single signature:

int printf(const char * restrict format, ...);

Upvotes: 1

haccks
haccks

Reputation: 106102

No. Its not function overloading. C doesn't support overloading. printf is variadic function which accepts a variable number of arguments.

Upvotes: 1

Related Questions