It depends on if you want to pass the vector as a reference or as a pointer (I am disregarding the option of passing it by value as clearly undesirable).
As a reference:
int binarySearch(int first, int last, int search4, vector<int>& random);
vector<int> random(100);
// ...
found = binarySearch(first, last, search4, random);
As a pointer:
int binarySearch(int first, int last, int search4, vector<int>* random);
vector<int> random(100);
// ...
found = binarySearch(first, last, search4, &random);
Inside binarySearch, you will need to use . or -> to access the members of random correspondingly.
Issues with your current code
binarySearchexpects avector<int>*, but you pass in avector<int>(missing a&beforerandom)- You do not dereference the pointer inside
binarySearchbefore using it (for example,random[mid]should be(*random)[mid] - You are missing
using namespace std;after the<include>s - The values you assign to
firstandlastare wrong (should be 0 and 99 instead ofrandom[0]andrandom[99]