The floatval() function return the float value of the variable passed to it. For example:
$integer = 123;
$float = floatval($integer);
var_dump($integer); // int(123)
var_dump($float); // float(123)
Here is the example:
void foo(void) {
printf(“foo was called\n”);
}
if you do this:
foo();
then you’re calling do by name. If you do:
void (*func_ptr)(void) = foo;
func_ptr();
Then you’re calling foo through function pointer func_ptr().
void f(int i) { i = i + 1; }
void g(int &i) { i = i + 1; }
int main() {
int i = 1;
f(i); // by value: i is still 1
g(i); // by reference: i is now 2
return 0;
}