You're declaring
void err(float e_prob) inside your main code. Move it outside of the main - you can't declare a function within main()
There are two ways of creating a function:
cpp
void err(float e_prob); //Declaration
int main()
{
. . .
}
void err(float e_prob) //Definition
{
. . .
}
Or, you can do it without a declaration. (I prefer to declare it and define it later - this way, you can easily look at a list of all your functions without having to scroll through loads of code just to find all your functions

The other way (without the declaration) is as follows:
cpp
void err(float e_prob) //Immediate definition
{
. . .
}
int main()
{
. . .
}
As for your second problem, I ***THINK*** that once you've solved this problem, the other one should fix itself

Hope this helps