The problem is this line:
cout << karatsuba(123, 456, counter) << " " << counter << endl;
Try instead
cout << karatsuba(123, 456, counter);
cout << " " << counter << endl;
the problem is cout, count is still 0 when it prints.
3
solved C++ – Recursive counter [closed]