[Solved]creat functions in mainwindow.cpp
General and Desktop
5
Posts
2
Posters
1.1k
Views
1
Watching
-
Is function test() defined in mainwindow.cpp?
Is it defined before first use?If not then you need to declare it before first use.
- mainwindow.cpp
@
int test(int, int); // <-- this is a declaration
void MainWindow::on_pushButton_clicked()
{
int aa=4;
int bb=0;
int cc=0;
cc=test(aa,bb);
}int test(int a,int b)
{
int c;
c=a*b;
return c;
}
@ - mainwindow.cpp