int main ()

I have this question how would find the headers for the five functions that are below without supplying the blocks for them, i dont quite understand it


int x, c;

double r;

x = readData ();

for (c = 0; c < 5; c++)

printValues (x, r + 1);

x = adjust (x + 2);

r = max3 (x, c, 10);

return fun (x + c, x - c);


Edited by WaltP: Added CODE Tags -- please use them.

6 Years
Discussion Span
Last Post by rubberman

The functions you use, like readdata() and printvalues() are in another translation unit (fancy name for source file or library). Normally you include the necessary headers where the functions are declared, and link the program with the object file or library that contains the implementation of the function. Something like this:

#include <stdlib.h>
#include <someheader.h>

int main(void)
   // Calling functions declared in someheader.h
   return 0;

Now, when you like the executable, you either need to link the object file, such as somefunctions.o (somefunctions.obj for Windows), or the library that contains them, such as libsomefunctions.so (libsomefunctions.dll for Windows).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.