Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Пример1. Указатели: типизированный, не типизированный и приведение к типу; управление памятью; операции
- #include <iostream>
- using namespace std;
- int main() {
- int a = 10;
- void * ptr = &a;
- cout << *(int*)ptr << " " << *(double*)ptr << endl;
- int * p = new int;
- *p = 100;
- cout << *p << endl;
- delete p;
- cout << *p << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment