UPDATE 19.02.2015All the type conversions have been handled, all the functions have been written and the code has been tested to be A OK! Except for this one little bugger, which took some 4-5 days to find...
So for some reason I can only fetch the value of this string ONCE...Until recently I believed the problem was with my string separation functions (I had used a previously tested method, new methods including string streams, vectors etc..) and the all didn't work because there wasn't any value to the parameter variable passed to them. How cool is that.
I believe SQLite3 had some warning about accessing variables after the database connection was closed, however I had not encountered this problem with the previous 3 database access points.
On the bright side, the rest of the code seems to be working properly and It does not crash when it hits the last 'for' loop. Can't wait to fix this up and get started on improving the program! Also I am exploring the idea of creating a grammar processing engine (library) for C/C++. However I see no way to incorporate it into Jarvis since it is also meant to 'understand', in a way, what the user is saying (what he wants). It will require me to brush up on linguistic morphology though.
Sub-Update #1It would seem that I have accidentally fixed this bug while trying to pinpoint the error line. However, the output is now more mystifying than ever...
I understand there is an undesired looping somewhere, but the weirdest part is that I do not have a single 'cout' or variable containing a value of "amazing" (bottom right).
Sub-Update #2I found out that the mysterious 'amazing' came from the return word database because it was of type 'A' and 'A' was the only type (char) that the program extracted from the output pattern string.
As you can see I have solved that problem and the problem correctly extracts the 'type' characters from the string (and in the correct order). The next step (and obstacle) is to convert the character vector containing them into a string vector. The compiler spots a problem in some core MinGW libraries, however the real reason is that the function that is supposed to do that can only take 'char*' and not 'char'.
There might be a more efficient way to break a string (such as "N C T A") and store the elements individually into a string vector, but keep in mind I don't (and don't intend to) get paid for this lol. One step at a time, though - progress has been constant so far so I am not worried about failure.
Sub-Update #3I did some tests on a separate .cpp file so I could focus and keep better track. Turns out I can cut off roughly 25-35 lines of code from the FOF() function. Look at that simplicity:
I stumbled upon a nice, not-so-highly voted answer on Stack Overflow. Line 22 is the key to many gates. Will attempt to implement this into my program tomorrow - got all Friday night to spend on it.