#include <iostream>

// Dit programma zet een c-string om naar een int.
// Dit slaat inderdaad nergens op maar laat wel zien hoe we compiler kunnen dwingen om zoiets toch te doen
// door middel van een zogenaamde type cast

int main() {
	int i;
//	i="Hallo";
//	[C++ Error (Borland)]   Cannot convert 'char *' to 'int'
//	[C++ Error (Microsoft)] '=' : cannot convert from 'const char [6]' to 'int'
//	[C++ Error (gcc)]       invalid conversion from `const char*' to `int'
	i=(int)"Hallo"; // oude C syntax
	std::cout<<i<<std::endl;
	i=int("Hallo"); // oude C++ syntax
	std::cout<<i<<std::endl;
	i=reinterpret_cast<int>("Hallo"); // nieuwe C++ syntax
	std::cout<<i<<std::endl;
	std::cin.get();
	return 0;
}

/*
Output:
4210876
4210882
4210888
*/
