Check out example codes for "how to end a c++ program early". It will help you in understanding the concepts better.

Code Example 1

void func( bool d )
{
    if( ! ( d ) )
        return;

    //Load of code here that you don't want to execute if the above is incorrect.
}

Learn ReactJs, React Native from akashmittal.com