関数宣言で function を呼び出すと、 が得readTransition()
られます。自分で定義した関数を別の関数の宣言で使用するにはどうすればよいですか?readDPDA()
linker error: undefined reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void readTransitionRules(char * temp);
void readDPDA(char * filename);
int main()
{
// irrelevant
}
void readTransitionRules(char * temp)
{
char *tempToken;
tempToken=strtok(temp," ,:");
int i;
for(i=0; i<5; i++)
{
printf("%s",tempToken);
strtok(NULL," ,:");
}
}
void readDPDA(char * filename)
{
/*This function tries to open DPDA text file to read
states,alphabet,stack symbols and transition rules
of the DPDA that we will use as Word Checker. */
extern void readTransitionRules(char * temp);
char * temp;
FILE * readerForDPDA;
readerForDPDA = fopen(filename,"r");
if(readerForDPDA!=NULL)
{
fgets(temp,30,readerForDPDA);
if(temp[0]=='T')
{
readTransitionRule(temp);
}
}
else
{
}
}