c++ - Findfactorial was not found in this scope -
every time run qt program, gives following error:
findfactorial not found in scope
could suggest why? have function in mainwindow.cpp
int findfactorial(int x){ if(x == 1){ return 1; } else { return x*findfactorial(x-1); } } mainwindow.h :
class mainwindow : public qmainwindow { q_object public: explicit mainwindow(qwidget *parent = 0); bool ok = false; int findfactorial(int x); ~mainwindow(); private slots: void on_clear_button_clicked(); void on_sqr_button_clicked(); void on_exp_two_button_clicked(); void on_pi_button_clicked(); void on_ceil_button_clicked(); void on_factorial_button_clicked(); private: ui::mainwindow *ui; };
you have explicitly scope/namespace function belongs using scope resolution operator.
int mainwindow::findfactorial(int x){ if(x == 1){ return 1; } else { return x*findfactorial(x-1); } }
Comments
Post a Comment