how do i iterate the pair array arguments passed as a pointer ?
i had tried to use as reference pair &arr . but it doesnt worked either . can i pass pair<lli,lli> a[n];
as reference ??
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#define LOCAL
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
typedef long long int lli;
typedef unsigned long long int ulli;
void yeah( pair<lli,lli> *arr ){
// cout << arr[0].ff; 100
//this doesnt work :(
for(auto e : arr){
cout << e.ff << " " << e.ss << endl;
}
}
int main() {
int n = 10;
pair<lli,lli> a[n];
a[0].ff = 100;
a[1].ss = 150;
yeah(a);
}
this is the error im getting
prog.cpp: In function 'void yeah(std::pair)': prog.cpp:13:18: error: no matching function for call to 'begin(std::pair&)' for(auto e : arr){ ^ ^