C++/Development/Reinterpret cast — различия между версиями

Материал из C\C++ эксперт
Перейти к: навигация, поиск
м (1 версия: Импорт контента...)
 
(нет различий)

Версия 14:21, 25 мая 2010

An example that uses reinterpret_cast.

#include <iostream>
using namespace std;
int main()
{
  int i;
  char *p = "This is a string";
  i = reinterpret_cast<int> (p); // cast pointer to integer
  cout << i;
  return 0;
}