Advertisement
RobertDeMilo

RB3.3 Оператор new

Apr 16th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     //1//int* pInt = new int;
  11.  
  12.     /*//2//string* s = new string;
  13.  
  14.     *s = "Hello";
  15.  
  16.     cout << *s << ' ' << s->size() << endl;
  17.    
  18.     string& ref_to_s = *s;
  19.  
  20.     ref_to_s += ", world";
  21.  
  22.     cout << *s << endl;*/
  23.  
  24.     int* pInt = new int(42);
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement