Update gtk130

This commit is contained in:
daleclack 2022-06-09 13:45:12 +08:00
parent edc0fd2bbf
commit a233a4fe4b
3 changed files with 6 additions and 0 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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();