I think you'll have to clarify your question a bit more, but in general, you have to declare (but not define) every function you use in a given translation unit. If you want to use srand in a .cpp file, you'll have to #include <stdlib.h>
in that file.
For the usage of srand - take a look at its documentation. You'll usually only need to call it once in a given process, after which you can expect the same sequence of pseudo-random values each run. Calling it again with the same seed will restart the sequence of values. If you're wanting different values each run, try seeding with the current time.
EDIT:
Do you mean that you have two files something like this:
// Driver.cpp
#include <stdlib.h>
#include "otherfile.h"
int main()
{
srand(2);
Somefunc();
}
And then another file linked in:
// OtherFile.cpp
#include <stdlib.h>
#include "otherfile.h"
void SomeFunc()
{
// You don't need to call srand() here, since it's already been called in driver.cpp
int j = rand();
}