Question

(C programming) (Function arguments) Design a function prototype that can accept any type of argument and...

(C programming)

(Function arguments) Design a function prototype that can accept any type of argument and return an integer.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

function protorype format in c is as follows :

return_type function_name(argument list.....);

For the question asked ... prototype is as follows: -

int func(double a);

Note that there is no templates in C , but you want it to be generic , then we can have this using C++ as follows: -

template<class T> int func1(T a) ;

here T can be any type and the function's return type is int.

Add a comment
Know the answer?
Add Answer to:
(C programming) (Function arguments) Design a function prototype that can accept any type of argument and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT