I've this C++ program, when I run the debugger it fails to show the return value of the f1
.
#include <iostream>#include <vector>#include <string>using namespace std;string f1(vector<int> v) { return "this takes in a vector\n";}string f2(int x[]) { return "this takes in an array\n";}int main() { vector<int> vec = {1, 2, 3}; string x = f1(vec); cout << x; int arr[] = {1, 2, 3}; string y = f2(arr); cout << y;}
When I run the program, both f1
and f2
execute as expected, and I see the correct output.
However, when I debug the program:
The debugger evaluates the return value of f2(arr)
.
The debugger fails to show the return value of f1(vec)
.