Is there a way to shorten this while condition?

Sure, you could just use a string of valid operators and search it. #include <cstring> // : : const char* ops = “+-*/”; while(strchr(ops, temp->left->oper) || strchr(ops, temp->right->oper)) { // do something } If you are concerned about performance, then maybe table lookups: #include <climits> // : : // Start with a table initialized to … Read more

Strategies for simplifying math expressions

You probably want to implement a term rewriting system. Regarding the underlying math, have a look at WikiPedia. Structure of a term rewrite module Since I implemented a solution recently… First, prepare a class CExpression, which models the structure of your expression. Implement CRule, which contains a pattern and a replacement. Use special symbols as … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)