| 7 | float (*norm_ptr)(float x, float y); //norm_ptr is a function pointer |
| 8 | |
| 9 | int main() |
| 10 | { |
| 11 | norm_ptr = norm_l1; //Pointer norm_ptr is pointing to norm_l1 |
| 12 | cout << "L1 norm of (-3, 4) = " << norm_ptr(-3.0f, 4.0f) << endl; |
| 13 | |
| 14 | norm_ptr = &norm_l2; //Pointer norm_ptr is pointing to norm_l2 |
| 15 | cout << "L2 norm of (-3, 4) = " << (*norm_ptr)(-3.0f, 4.0f) << endl; |
| 16 | |
| 17 | return 0; |
| 18 | } |
| 19 | |
| 20 | float norm_l1(float x, float y) |
| 21 | { |
nothing calls this directly
no outgoing calls
no test coverage detected