#include <iostream>
#include <cstring>
using namespace std;

int main(){
	int V=101;
	//float *P=&V ERROR
	float *P=reinterpret_cast<float *>(&V);
	cout<<"Successfull cast! Address of V as float pointer: "<<P<<endl<<endl;
	char myText[]="Hello World";
	char *pStr=myText;
	//Το pStr δειχνει στο γραμμα Η
	cout<<"What cout sees in pStr: "<<pStr<<endl;
	cout<<"The actual address of pStr (with void *): "<<reinterpret_cast<void *>(pStr)<<endl<<endl;
	//Δεν βαζουμε strlen() σε λουπα
	int n=strlen(pStr);
	cout<<"Length of string: "<<n<<" characters."<<endl;
	for(int i=0;i<n;i++){
		//pStr συμπεριφερεται σαν κανονικος πινακας
		cout<<"Character "<<i<<": "<<pStr[i]<<endl;
	}
	return 0;
}
