As I said, I want to make simple chatbot that is capable to make some calculations (e.g. when you ask him "what is sum of 2 and 2?" it should respond 4), etc. Also such function makes parsing files much easier.
As I said, I want to make simple chatbot that is capable to make some calculations (e.g. when you ask him "what is sum of 2 and 2?" it should respond 4), etc. Also such function makes parsing files much easier.
You probably need to use a tokenizer for that kind of things to parse the input correctly, since you don't know what may it consist of (so can't use sscanf). As for file parsing, yes it does make it easier, if you know the structure is fixed. If the structure is variable, well then you're at point 1. Split the input by spaces and decide what type you want to cast the parts to, based on context.
my projects https://github.com/dpethes
Bookmarks