there shouldn't be a { between the function name and the list of function arguments. Therefore this:
void getboard {(qtype item);
should be this:
void getboard (qtype item)
{
or this:
void getboard (qtype item) {
and likewise in all of the functions.
There should not be a semicolon after the closing brace } of functions.
strcpy() has two arguments, the destination char array comes first, then a comma, then the source char array. None of your calls to strcpy() follow that format. The source string presumably will come from the file you are reading, but your code never actually reads anything from file, that is there are no calls to >> or get() or getline() or whatever. Given the string is a title of a post or a question raised, there will probably be spaces embedded in the string so you will probably want to use getline() to read the file data in. Given that there will probably be many questions stored in the FAQ you will probably want to store the input in a container of some sort to search, although you could do a strcmp() to compare each string as it is read in with the string from the users post and if there isn't a "match" go to the next string in the file. All of this however, still doesn't settle how you are going to accomplish the matching process given the wide latitude/variability in phrasing questions. The matching process is somehting that probably is in the realm of artificial intelligence, and since I have enough trouble with my own, that topic is far beyond my capability.



LinkBack URL
About LinkBacks


