Re: including files
- From: David Wilkinson <no-reply@xxxxxxxxxxxx>
- Date: Tue, 18 Apr 2006 09:40:23 -0400
Eitan M wrote:
Yes,
I have included the *.c files under "source files".
But if the "*.c" program has main function,
program isn't compiled.
(I want to use some functions of the included file, which is not the "main" function, can I just declare the functions I want to use only at the header).
Thanks :)
Eitan:
Declare function in the header:
void f(); // declaration, no definition
Define function in one .c file only:
void f()
{
printf("Hello world\n");
}
Include the header file in the .c file that defines f(), and in every .c file that wants to use it. That way you can be sure that the prototype matches the actual function definition.
What problem are you having?
David Wilkinson
.
- Follow-Ups:
- Re: including files
- From: Ulrich Eckhardt
- Re: including files
- References:
- including files
- From: Eitan M
- Re: including files
- From: Ulrich Eckhardt
- Re: including files
- From: Eitan M
- Re: including files
- From: Scott McPhillips [MVP]
- Re: including files
- From: Eitan M
- including files
- Prev by Date: Re: using strings functions
- Next by Date: getchar is read more than one character
- Previous by thread: Re: including files
- Next by thread: Re: including files
- Index(es):
Relevant Pages
|