Can anyone explain functions to me? I need to write a 3 function program that calculates distance and slope, I am also using a bool function so that I can tell if the slope is infinite.
...but basically they are blocks of code that can be executed, and they can have a 'return' statement (unless the function is 'void') that allows them to return data back to whatever called them.
What is a boolean function? As far as I know all functions are regular functions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
void f() //regular function
{
cout << "Hello, world!" << endl;
}
int g(int a, int b) //regular function
{
return 7*a + b;
}
bool h(int x, int y, int z) //regular function
{
return x == 7*y && 7*x = z;
}
It's a matter of english syntax.
If someone said to me 'boolean function', I would know they were talking about a function that returns a boolean datatype.
Sure maybe it's not the right way to say it by your standards, but really, who gives a shit.