Our assignment is to write a program that tests our teacher's code. He has written 4 files for us to "test". However, when I try and compile it, it cant find only 1 of his functions, but the rest it does fine on. Ill attach the relevent part in my code, and how he has his code set up.
Code:
#include <stdio.h>
#include <stdlib.h>
#include "ssm.h"
#define DEBUG 1
int l;
l = eat_comment(argv[2]);
The only difference between the rest of the functions, and "eat_comment()" is that it is in the same file as read_route, and ssm.h doesnt mention eat_comment. Is there a way to get it to recognize eat_comment without changing his code?
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ssm.h"
#define VERSION "0.5"
static int eat_comment(FILE *fp); // eats commnts and white space
static int line; // line in file currently being read.
// int read_route(const char *file, const Route *route) {
int read_route(const char *file, Route *route) {
.
.
.
}
// eat_comment() eats white space and commnets, incrementiong
// the line counter as it goes. If one of the fscanfs above
// eats a '\n' between parameters, the line count will be off.
// Perhaps the "line" count is not such a good idea here after all
// That can be fixed if above '\n' is not accepted as a delimiter
// between parameters. hummm....
static int eat_comment(FILE *fp) {
.
.
.
}
And the ssm.h part where it includes read_route and write_route :
Code:
defines a bunch of variables/structs...
int read_route(const char *file, Route *route);
int write_route(const char *file, const Route *route);