Hi all....
To make the long story short I have the following function declaration in my program:
Code:
bool examine_string(int array[][ASCII_INDEX], char string[], int accepting_states[], int size);
and my function definition is:
Code:
//---------------------------------------------------------------------------------------
// test_strings() function
//
// Arguments: double array of ints, single array of characters (string)
//
// Return Value: bool (true or false) that corresponds to accepts or reject respectively
bool test_string(int array[][ASCII_INDEX], char string[], int accepting_states[], int size)
{
int length = strlen(string);
cout << length << endl;
int trap_state = 0;
int current_state = 0;
for(int i = 0; string[i] != '\0' && i < length; i++) // loops for every character...
{
if(array[current_state][string[i]] == trap_state)
{
return false; // means no tranistion defined from that state given
} // that chracter transition...
else
{
current_state = array[current_state][string[i]]; // if such transition exists
} // then assign new state to
} // current_state...
for(int j = 0; j < size; j++) // examine if the finishing state of the string is
{ // an accepting state or a rejecting state...
if(current_state == accepting_states[j])
return true;
}
return false; // if all the accepting states got examined and none of them
// match our final state then string is rejected...
}
//---------------------------------------------------------------------------------------
syntatically compiler is doing ok, but during linkage i'm getting the following error:
CIS_280_DFSA error LNK2019: unresolved external symbol "bool __cdecl examine_string(int (* const)[128],char * const,int * const,int)" (?examine_string@@YA_NQAY0IA@HQADQAHH@Z) referenced in function _main
I think it has to do with the call signature but I'm not seeing it, can anyone point me in the right direction or even perhaps explain the error....
Thanks in advance...
........................
matheo917