Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include "string.h"
  3.  
  4. using namespace std;
  5.  
  6. class Test
  7. {
  8. private:
  9. char a, b;
  10.  
  11. public:
  12.  
  13. void setQ(char Q_a, char Q_b)
  14. {
  15. a = Q_a;
  16. b = Q_b;
  17. }
  18.  
  19. void Sum()
  20. {
  21. strcat(a, b);
  22. }
  23.  
  24. void getQ()
  25. {
  26. cout << a << endl;
  27. }
  28.  
  29. };
  30.  
  31. int main()
  32. {
  33. char a, b;
  34.  
  35. cin >> a, b;
  36.  
  37.  
  38. Test Obj;
  39.  
  40. Obj.setQ(a, b);
  41. Obj.Sum();
  42. Obj.getQ();
  43.  
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement