科目名稱:資訊系統 與網路導論 | 開課系所:資訊工程 學系 | 任課教師 |
吳坤熹 |
||
系所別: |
年級: |
學號: |
姓名: |
考試日期 |
2008.1.8 |
(考試時間: 8:10-8:20)
#include <iostream>
using std::cout;
using std::endl;
double sum(double x, double y)
{
return x + y;
}
double product(double x, double y)
{
return x * y;
}
double difference(double x, double y)
{
return x - y;
}
int main()
{
double (*pfun[3]) (double, double) = {sum, product, difference };
cout << pfun[1](2.5, 3.5) << endl;
cout << *(pfun+1) (2.5, 3.5) << endl;
}
#include <iostream>
using std::cout;
using std::endl;
double sum(double x, double y)
{
return x + y;
}
double product(double x, double y)
{
return x * y;
}
double difference(double x, double y)
{
return x - y;
}
int main()
{
double (*pfun[3]) (double, double) = {sum, product, difference };
cout << pfun[1](2.5, 3.5) << endl;
cout << (*(pfun+1)) (2.5, 3.5) << endl;
}