// Example global.cpp // Using a global variable. // This modern include file syntax // will be explained later. Here // including stdlib.h is not // necessary. #include using namespace std; int sum = 0; int main() { void update(int); update(5); update(8); cout << sum << endl; return EXIT_SUCCESS; } void update(int n) { sum += n; } // Output: 13