[ back to toc ]

function

Date: 2002/05/21 11:16

Q:
i have written a function,function name is(fun) for converting a number
in to a roman number in a separate file with func.c
extension and i have written separate file use.c
for passing the arguments to func.c from use.c by including
#include<func.c> in use.c
but iam gettting error cannot include the file please
clarify my mistake.what should i do for this?..
A:
#include <filename.h>

tries to include a system file from configured directories.

#include "filename.h"

will include a file from the current directory, (or rather from the
directory where the file is that includes the other file). Use double
quotes.

Usually it is not a good practice to include a file that contains code and
not only declaration. Rather you have to create a header file that defines
the function and compile the two files into object file and link them.

However you will learn it as you advance in C programming.

regards,
Peter

[ back to toc ]