#include<iostream>
#include <vector>
using namespace std;
int size_f(vector<int> adj[])
{
return sizeof(adj);
}
int main()
{
vector<int> adj[] = {{0, 1}, {0, 2}, {1, 2}, {2, 3}};
cout << sizeof(adj) << endl;
cout << size_f(adj);
}
96
8
This is my program and its result. I don't understand why size_f
return 8. Can you explain it for me? And how can I know size of array that is parameter of my funtion. Thank you.