199. Lambdas and Callback Management

Question.3

Two lambdas capture the same variable differently:

int count = 10;
auto by_val = [count]()  { return count; };
auto by_ref = [&count]() { return count; };

count = 99;
printf("%d %d", by_val(), by_ref());

What is the output?

Need Help? Refer to the Quick Guide below

Select Answer