#include <stdio.h>
#include <math.h>
#include <windows.h>

// this example demonstrates global constructors/destructors,
// throwing exceptions, and math functions

class CGl
{
public: 
	CGl() { puts("constructed!");}
	~CGl() {puts("destructed!");}
} glob;

int main(int argc, char**argv)
{
	try {
		puts("hello world!");
		throw "a string exception";
	} catch(int a)
	{
		printf("Got exception value %d\n",a);
	} catch(const char *a)
	{
		printf("Got exception value '%s'\n",a);
	}
	for(float a=0; a<3; a+=0.3)
	{
		printf("%d ",(int)(sin(a)*10.0));
		for(int i=0; i<sin(a)*10.0; i++)
			printf(" ");
		puts(".");
	}
	puts("Waiting 5 sec...");
	Sleep(5000);
}
