0
Is it possible to use different data type arguments in functions in C ???
Can we use different arguments in C functions ? e.g. :- void demo() int main(){ float f = 23.785; char ch = 'C'; demo(f, ch); } void demo(f, ch) { printf ("%f%c", f, ch); }
2 RĂ©ponses
+ 2
Yes you can do this but when you define these function then you also have to write return type of parameters you made
void demo()
function in your program this is wrong you have to write like this
void demo(float a, char ch) .
Void demo()
this is valid when u don't want to pass any Values.
0
You can declare functions with any type with any number of parameters. Declare like this:
type func_nams( type parameters1, type parameters2...)
In your case you can declare:
void demo(float f, char c)