我不明白为什么会报错 error: expected initializer before ‘int’,请大牛帮我看看。我是初学者。谢谢了
#include <iostream>
using namespace std;
void result_time(int hours, int minutes)
int main(void)
{
int h, m;
cout << "Enter the number of hours: ";
cin >> h;
cout << "Enter the number of minutes: ";
cin >> m;
result_time(h, m);
return 0;
}
void result_time(int hours, int minutes)
{
cout << "Time: "<< hours << ":" << minutes << endl;
}