Yurttas/PL/IL/C/F-mar11/02/04/06/j/m 23.cpp
Jump to navigation
Jump to search
1/*
2 Copyright(C) 1998
3 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4
5 Permission to use, copy, modify, and distribute this
6 software and its documentation for EDUCATIONAL purposes
7 and without fee is hereby granted provided that this
8 copyright notice appears in all copies.
9
10 date : January 1, 1998.
11 author : Salih Yurttas.
12
13 m_23.cpp
14*/
15
16
17// the rule: minimize or eliminate the globals
18// use locals
19
20
21#include <iostream>
22
23using namespace std;
24
25int a = 1;
26
27extern void h();
28
29int main(int argc, char* argv[]) {
30
31 int i = 0;
32
33 cout << "m / ";
34 cout << ++i;
35 cout << endl;
36 cout << "a = ";
37 cout << ++a;
38 cout << endl;
39
40 cout << endl;
41
42 h();
43
44 cout << endl;
45
46 cout << "m / ";
47 cout << ++i;
48 cout << endl;
49 cout << "a = ";
50 cout << ++a;
51 cout << endl;
52
53 cout << endl;
54
55 h();
56
57 cout << endl;
58
59 cout << "m / ";
60 cout << ++i;
61 cout << endl;
62 cout << "a = ";
63 cout << ++a;
64 cout << endl;
65
66}