Michael_Fedorov

Untitled

Feb 23rd, 2021 (edited)
315
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Question 1
  2. #include <iostream>
  3.  
  4. void print1(const char* str)        { std::cout << str << std::endl; }
  5. void print2(char* str)              { std::cout << str << std::endl; }
  6. void print3(std::string str)        { std::cout << str << std::endl; }
  7. void print4(const std::string str)  { std::cout << str << std::endl; }
  8. void print5(std::string &str)       { std::cout << str << std::endl; }
  9. void print6(const std::string &str) { std::cout << str << std::endl; }
  10.  
  11. int main()
  12. {
  13.     print1("hello1");
  14.     print2("hello2");
  15.     print3("hello3");
  16.     print4("hello4");
  17.     print5("hello5");
  18.     print6("hello6");
  19. }
  20.  
  21. //Qustion 2
  22. #include <iostream>
  23.  
  24. int main()
  25. {
  26.     unsigned char half = 150;
  27.     for (unsigned char i = 0; i < half * 2; i++)
  28.     {
  29.     }
  30. }
RAW Paste Data