Sunday 11 November 2012

Program illustrating Reinterpret Cast in C++

//Program illustrates the working of reinterpret_cast keyword in C++
#include<iostream>
#include<typeinfo>
using namespace std;

int main()
{

    char *s="Hello Friends";
    int i;

    i=reinterpret_cast<int>(s);
    cout<<"\ni is: "<<i;
    cout<<"\ns is: "<<s;

    return 0;
}


Click here to download the C++ Program.


No comments:

Post a Comment