Advertisement
Guest User

Untitled

a guest
Sep 4th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. classes.hpp
  2.  
  3. class Rectangle : public Figure
  4. {
  5. private:
  6.     int size;
  7. public:
  8.     int get(int a, b);
  9. }
  10.  
  11. class Circle : public Figure
  12. {
  13. private:
  14.     int size;
  15. public:
  16.     int get(int a, b);
  17. }
  18.  
  19. class Figure
  20. {
  21. public:
  22.     virtual  int get();
  23. }
  24. ........
  25. main.cpp
  26. int figures[10];
  27.  
  28. void save(int addr, Figure *dev_m) {
  29.   int64_t tempAddr = (int64_t)(int*)figure_m;
  30.   figures[addr] = tempAddr;
  31. }
  32. //далее, я уже работаю с сохраненными указателями так:
  33. Figure* figure_m = reinterpret_cast<Figure*>(figures[addr]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement