Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Question 1
- #include <iostream>
- void print1(const char* str) { std::cout << str << std::endl; }
- void print2(char* str) { std::cout << str << std::endl; }
- void print3(std::string str) { std::cout << str << std::endl; }
- void print4(const std::string str) { std::cout << str << std::endl; }
- void print5(std::string &str) { std::cout << str << std::endl; }
- void print6(const std::string &str) { std::cout << str << std::endl; }
- int main()
- {
- print1("hello1");
- print2("hello2");
- print3("hello3");
- print4("hello4");
- print5("hello5");
- print6("hello6");
- }
- //Qustion 2
- #include <iostream>
- int main()
- {
- unsigned char half = 150;
- for (unsigned char i = 0; i < half * 2; i++)
- {
- }
- }
RAW Paste Data