Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to parse a Math Equation from string to expression?
Forum Update on Monday, May 27th 2025

how to parse a Math Equation from string to expression?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    opengpu
    wrote on last edited by
    #1

    how to parse a Math Equation from string to expression?
    eg.i got this strinig from UI: "a+b-cd/e+f3+10012", how can i get the expression(which means a+b-cd/e+f3+10012 in code), can later, i can just caculate this equation whenver i want: int x = a+b-cd/e+f3+100*12;

    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by
      #2

      https://doc.qt.io/qt-5/qjsengine.html

      C++ is a perfectly valid school of magic.

      1 Reply Last reply
      3
      • Kent-DorfmanK Offline
        Kent-DorfmanK Offline
        Kent-Dorfman
        wrote on last edited by
        #3

        If you wish to correctly parse expressions, then this book you need to read: Compilers-Principles-Techniques-Alfred-Aho

        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved