Advertisement
bogolyubskiyalexey

Untitled

Mar 2nd, 2021
757
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. class Type {
  5. private:
  6.     class Some2 {
  7.     public:
  8.     };
  9. public:
  10.     struct Some {
  11.         int v;
  12.         void z() {
  13.         }
  14.     private:
  15.         void f() {
  16.         }
  17.     };
  18.     Some SomeField;
  19. };
  20.  
  21. class RefStorage {
  22. public:
  23.     RefStorage(int& number)
  24.         : number_(number)
  25.     {
  26.     }
  27. private:
  28.     int& number_;
  29. };
  30.  
  31.  
  32. int main() {
  33.     auto func = [](int a, int b) {
  34.         return a + b;
  35.     };
  36.     int c = func(10, 5);
  37.  
  38.     class SomeType {
  39.      
  40.     };
  41.     SomeType a, b;
  42.  
  43.  
  44.     std::vector<int>::iterator it;
  45.  
  46.     Type::Some q;
  47.     q.v = 10;
  48.     q.z();
  49.     Type w;
  50.     w.SomeField.z();
  51.  
  52.     freopen("err2.txt", "w" , stderr);
  53.  
  54.     int value;
  55.     std::cin >> value; // stdin;
  56.     std::cout << "zxcvbn" << std::endl; // stdout
  57.     std::cerr << "qwerty" << std::endl; // stderr
  58.  
  59.     int qwe = 1334;
  60.     int& zxc = qwe;
  61.     zxc = 1234;
  62.     &zxc;
  63.  
  64.     int* ptr  = nullptr;
  65.     ptr = &qwe;
  66.     *ptr = 12345;
  67.     std::cout << *ptr << std::endl;
  68.  
  69.  
  70.  
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement