main.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // #include "char_test.hpp"
  2. // #include "process_bar.hpp"
  3. #include "functions.h"
  4. #include "try_class.hpp"
  5. int main()
  6. {
  7. // test_char();
  8. // rotate();
  9. // test_func();
  10. // int num;
  11. // std::cout << "Input a num to check if it's prime num:\n> ";
  12. // std::cin >> num;
  13. // printf(isPrimeNum(num)?"Yes\n":"No\n");
  14. //////////////////////
  15. // Reference parameter
  16. //
  17. // int a = 3, b = 87;
  18. // std::cout << "A is " << a << " and B is " << b << std::endl;
  19. // swap(a, b);
  20. // std::cout << "A is " << a << " and B is " << b << std::endl;
  21. // char c = 'c', d = 'd';
  22. // std::cout << "C is " << c << " and D is " << d << std::endl;
  23. // swap(c, d);
  24. // std::cout << "C is " << c << " and B is " << d << std::endl;
  25. ///////////////
  26. // Trying Class
  27. //
  28. YoutubeChannel gg("C++ tutorial", "Lzl");
  29. gg.pub_video("C++ for beginners 1");
  30. gg.pub_video("C++ for beginners 2");
  31. gg.show_info();
  32. for (int subs = 0; subs < 98; subs++)
  33. {
  34. gg.subscribe();
  35. }
  36. gg.show_info();
  37. for (int unsubs = 0; unsubs < 15; unsubs++)
  38. {
  39. gg.unsubscribe();
  40. }
  41. gg.show_info();
  42. CookingYoutubeChannel gg2("How to cook cpp", "L-zl");
  43. gg2.pub_video("Cooking 123");
  44. gg2.pub_video("Apple pie");
  45. // gg2.show_info();
  46. gg2.practice();
  47. gg2.practice();
  48. gg2.practice();
  49. gg2.practice();
  50. gg2.practice();
  51. gg2.practice();
  52. // gg2.qualityCheck();
  53. SingingYoutubeChannel singer("Amy's sining", "Amy");
  54. // Using pointers to invoke functions
  55. YoutubeChannel * yt1=& gg2;
  56. YoutubeChannel * yt2=& singer;
  57. yt1->qualityCheck();
  58. yt2->qualityCheck();
  59. return 0;
  60. }