Revise the following short program so that it uses a lambda expression instead of f1(). Dont change

Question:

Revise the following short program so that it uses a lambda expression instead of f1(). Don’t change show2().
#include
template
void show2(double x, T& fp) {std::cout << x << " -> " << fp(x) << '\n';}
double f1(double x) { return 1.8*x + 32;}
int main()
{
show2(18.0, f1);
return 0;
}

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

C++ Primer Plus

ISBN: 9780321776402

6th Edition

Authors: Stephen Prata

Question Posted: