To call a function, you type the function name, followed by parenthesis. In functions which take no parameters, the parenthesis will be empty.
So, for example, to call your init function... you would do this:
init();
Here, you have the function name
init
. Followed by empty parenthesis to indicating you want to call the function.
The semicolon
;
exists only to mark the end of a statement, and does not have anything to do with the function call itself.
If you look at the code you posted... it
is doing that on line 4:
if( !init() )
Inside that if statement, it is calling init()
Note there is no semicolon here because it is not the end of the statement. This statement does more than just calling init.
The bang
!
is a logical NOT operator. It basically switches true<->false. So if init() returns true, the ! will make it false, and vice versa.
So.... basically... all of these are the same:
1 2 3 4 5 6 7 8 9 10
|
if( !init() )
// ... is the same as ...
if( init() == false )
// ... is the same as ...
bool temp = init();
if( temp == false )
|