#include <iostream>
using std::cout;
using std::endl;

// This example program illustrates calling functions via pointers

float calc1()
{
    return 3.14;
}

float calc2()
{
    return 2.72;
}

int main(void)
{
    float (*func_ptr)();  // declaration of the variable 'func_ptr'

    func_ptr = calc1;
    float result1 = (*func_ptr)();
    cout << "result1: " << result1 << endl;

    func_ptr = calc2;
    float result2 = (*func_ptr)();
    cout << "result2: " << result2 << endl;

    return 0;
}


