Update gtk130
This commit is contained in:
parent
edc0fd2bbf
commit
a233a4fe4b
|
@ -101,6 +101,7 @@ void MyWin::btnanswer_clicked(){
|
||||||
//std::cout<<text<<std::endl;
|
//std::cout<<text<<std::endl;
|
||||||
|
|
||||||
// Calculation
|
// Calculation
|
||||||
|
calc_reset();
|
||||||
int result = calc_expression_value(text.c_str());
|
int result = calc_expression_value(text.c_str());
|
||||||
char result_str[40];
|
char result_str[40];
|
||||||
sprintf(result_str,"%d",result);
|
sprintf(result_str,"%d",result);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
|
|
||||||
static int pos = 0;
|
static int pos = 0;
|
||||||
|
|
||||||
|
void calc_reset(){
|
||||||
|
pos = 0;
|
||||||
|
}
|
||||||
|
|
||||||
int calc_factor_value(const char * factor){
|
int calc_factor_value(const char * factor){
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
int calc_expression_value(const char * expression);
|
int calc_expression_value(const char * expression);
|
||||||
|
|
||||||
|
void calc_reset();
|
||||||
|
|
Loading…
Reference in New Issue