I m facing problem (in debugging window) to check values of an array of vectors arr once I call a function in which this array is passed as a pointer.
here is my code which has an array of vectors. And i pass this array as pointer to a function named as print_arr which basically prints the values of this array arr
MY CODE :
#include <bits/stdc++.h>
using namespace std;
void print_arr( vector <int> A[] ){
for ( int i =0; i<3; i++){
cout<<i<<" -> ";
for ( int j = 0; j<A[i].size(); j++)
cout<<A[i][j]<< " " ;
cout<<endl;
}
}
// Driver Code
int main()
{
vector <int> arr[3] ;
// pushing values int array of vectors
arr[0].push_back(1) ;
arr[0].push_back(2) ;
arr[1].push_back(10) ;
arr[1].push_back(20) ;
arr[2].push_back(100) ;
arr[2].push_back(200) ;
// printing the array of vector
print_arr ( arr ) ;
return 0 ;
}
I can see values of this array in debug window without any issue, before reaching to the breakpoint which calls this function (line 27)
But once my program calls this function, I start facing an issue to view the values of this array under the locals section in the debugging window.
How am I supposed to view the array elements if i pass the array as a pointer to a function ??