// -------------------
// GlobalVariables.c++
// -------------------
#include <cassert> // assert
#include <iostream> // cout, endl
int v;
int w = 1;
//const int cv; // error: uninitialized const "cv"
const int cv = 2;
static int sv;
static int sw = 3;
//static const int scv; // error: uninitialized const "scv"
static const int scv = 4;
int main () {
using namespace std;
cout << "GlobalVariables.c++" << endl;
assert(v == 0);
assert(w == 1);
assert(cv == 2);
assert(sv == 0);
assert(sw == 3);
assert(scv == 4);
cout << "Done." << endl;
return 0;}
syntax highlighted by Code2HTML, v. 0.9.1