From 2e2a8e8126c825d2c8c722f007b0dc005fa80476 Mon Sep 17 00:00:00 2001 From: sakshi292 <114948270+sakshi292@users.noreply.github.com> Date: Sat, 8 Oct 2022 14:41:44 +0530 Subject: [PATCH] Create C++2.cpp --- C++2.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 C++2.cpp diff --git a/C++2.cpp b/C++2.cpp new file mode 100644 index 0000000..6ab981a --- /dev/null +++ b/C++2.cpp @@ -0,0 +1,25 @@ +// CPP program to demonstrate working of +// reinterpret_cast +#include + +using namespace std; + + +int main() +{ + + int* p = new int(65); + + char* ch = reinterpret_cast(p); + + cout << *p << endl; + + cout << *ch << endl; + + cout << p << endl; + + cout << ch << endl; + + return 0; +} +Output