Trying to call a function from another file in C with the following code:
main.c
#include "display.h"
int main()
{
display_options();
display_price();
return 0;
}
display.h
int display_options(void);
int display_price(void);
display.c
#include <stdio.h>
int display_options()
{
printf("Welcome to the pizza parlor\n");
printf("What size pizza would you like? (in inches)");
return 0;
}
int display_price()
{
printf("Your pizza will cost 0.00\n");
return 0;
}
I created the following example here http://www.faqs.org/docs/learnc/x307.html , but it doesn’t seem to work, I get an error in code blocks 10.05 on a function called in main.c, saying "undefined link to" display_options "
source
share