tags:

views:

147

answers:

3

I would like to call the "C" function

fabs(double);

numerous times in my program, but I don't want to include the whole header file. Is this possible?

+15  A: 

It doesn't hurt to include the whole file.
Not used stuff will not be compiled into your executable.

z-boss
+6  A: 

Yep, you can manually prototype it. Just add

double fabs(double x);

to the top of your source file.

John Kugelman
+3  A: 

you could declare the function yourself, but why would you want to avoid including the header file ?

David Cournapeau
I was afraid that functions I did not use would be compiled in, but apparently this is not an issue.
Stu
ah, ok. I thought you wanted to avoid including headers to speed up the compilation process, but math.h is not very big in general.
David Cournapeau