Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


we all know about the function overloading concept used in
C++ and we all learnt abt that.... but that concept is
already came in C in a very smaller propotion ... my
question is IN WHICH CONCEPT THERE IS A USE OF FUNCTION
OVERLOADING IS USED in C language?????????????

Answers were Sorted based on User's Feedback



we all know about the function overloading concept used in C++ and we all learnt abt that.... but t..

Answer / sandeep

Function Overloading or Polymorphic Behaviour for C
functions can be seen for those functions who accept
variable number of arguments.
They can take any number of arguments and any type of
arguments, its upon the programmer or the code inside it,
that decides what it wants those arguments to be , int ,
char ,float or something else..

ALthough it is not seperate function that runs for different
number and types of arguments, still for the user, a
function will be provided for different types of list of
input parameters, all being sent to the same ('name of the
')function..

#include <stdarg.h>
enum data_type{ TYPE_INT=0,TYPE_STRING=1};
int max( int num_of_arguments,...)
{
va_list arg_list;
va_start(arg_list, num_of_arguments);
data_type type=va_arg(arg_list,data_type);

if(type=TYPE_INT)
{
int max =0,i;
for(i = 2; i <= num_of_arguments; i++)
{
if((a = va_arg(arg_list, int)) > max)
max = a;
}
}
else
{
//do whaterver..
}
va_end(arg_list);

}

Is This Answer Correct ?    10 Yes 2 No

we all know about the function overloading concept used in C++ and we all learnt abt that.... but t..

Answer / vaidyanathan

Hi,MY name is vaidyanathan....and and we have used such type of concepts in the recursion..

Is This Answer Correct ?    2 Yes 0 No

we all know about the function overloading concept used in C++ and we all learnt abt that.... but t..

Answer / rohit

Function Overloading or Polymorphic Behaviour for C
functions can be seen for those functions who accept
variable number of arguments.
They can take any number of arguments and any type of
arguments, its upon the programmer or the code inside it,
that decides what it wants those arguments to be , int ,
char ,float or something else..

ALthough it is not seperate function that runs for different
number and types of arguments, still for the user, a
function will be provided for different types of list of
input parameters, all being sent to the same ('name of the
')function..

#include <stdarg.h>
enum data_type{ TYPE_INT=0,TYPE_STRING=1};
int max( int num_of_arguments,...)
{
va_list arg_list;
va_start(arg_list, num_of_arguments);
data_type type=va_arg(arg_list,data_type);

if(type=TYPE_INT)
{
int max =0,i;
for(i = 2; i <= num_of_arguments; i++)
{
if((a = va_arg(arg_list, int)) > max)
max = a;
}
}
else
{
//do whaterver..
}
va_end(arg_list);

}

In c we are not allowed to function overloading with
parameters wherever we like.

Is This Answer Correct ?    0 Yes 1 No

we all know about the function overloading concept used in C++ and we all learnt abt that.... but t..

Answer / venkatesh

In c also we are allowed to function overloading with
parameters wherever we like.

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More C Interview Questions

Write a Program to print this triangle: * ** * **** * ****** * ******** * ********** use two nested loops.

12 Answers   MIT, TCS,


write a c program that prints all multiples of 3between 1 and 50.

5 Answers  


Explain what is the stack?

0 Answers  


the number 138 is called well ordered number because the three digits in the number (1,3,8) increase from left to right (1<3<8). the number 365 is not well ordered coz 6 is larger than 5. write a program that wull find and display all possible three digit well ordered numbers. sample: 123,124,125,126,127,128,129,134 ,135,136,137,138,139,145,146,147 148 149,156.......789

5 Answers  


Is c still relevant?

0 Answers  


What is memory leak in c?

0 Answers  


What are the ways to a null pointer can use in c programming language?

0 Answers  


Explain main function in c?

0 Answers  


Is c is a procedural language?

0 Answers  


Is c an object oriented programming language?

1 Answers  


What's the difference between constant char *p and char * constant p?

0 Answers   Celstream,


what are far pointers?

1 Answers  


Categories