Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int outer_API_bar()
- {
- // Modify internal state
- internal_foo()
- }
- int internal_foo()
- {
- // Do stuff
- if (internal_state_variable)
- {
- // Do some more stuff
- internal_state_variable = false;
- }
- }
- int outer_API_bar()
- {
- // Modify internal state
- internal_foo(internal_state_variable)
- // This could be another function if repeated many
- // times in the module
- if (internal_state_variable)
- {
- internal_state_variable = false;
- }
- }
- int internal_foo(bool arg)
- {
- // Do stuff
- if (arg)
- {
- // Do some more stuff
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement