Results 1 to 6 of 6

Thread: sscanf C function equivalent?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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.

  2. #2
    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •