Help - Search - Members - Calendar
Full Version: C Programming Question
Boostcruising.com > Computers and Technology > Tech Head Corner
3000GTCapri
Hi
I am writing a automation program in c.

I would like to have all my functions stored in an external file
and have my main program call up these external functions.
thus keeping my main source file reletively clutter free, just calling each function from external files.

I am having trouble getting them linked, as my main source file can't find the external function.

I also created a header file to define my function type.

Could some one please give me a simple example,
of calling a function from another .c file.

Thanks in advance.
MarcD
Um.. It should be a simple matter of adding a #include<blah.h> into the source (where blah.h is the header file that you just created).
3000GTCapri
done that mate, won't link
n_one
http://tinyurl.com/yjl9u7y
MarcD
QUOTE (3000GTCapri @ Oct 22 2009, 06:43 PM) *
done that mate, won't link


Paste an example of what you have.
8URVTEC
Yeah if u wannt to link tour files then
#include<blah.h>

but u have to set private an public functions then make a parametrized constructors to call the functions.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.