Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include "Napis.h"
  3. #include <stdio.h>
  4. #include <iostream>
  5.  
  6. using namespace std;
  7.  
  8. Napis::Napis()
  9. {
  10. }
  11.  
  12.  
  13. Napis::~Napis()
  14. {
  15. }
  16.  
  17. const char* Napis::Zwroc() const
  18. {
  19. return m_pszNapis;
  20. }
  21.  
  22. void Napis::Ustaw(const char* nowy_napis)
  23. {
  24.  
  25. strncpy(m_pszNapis, nowy_napis, 40);
  26.  
  27. /* int i = 1;
  28. for (int i = 0; nowy_napis[i] != '\0'; i++)
  29. {
  30. m_pszNapis[i] = nowy_napis[i];
  31. }
  32. m_pszNapis[i] = '\0';
  33. }
  34. */
  35. }
  36.  
  37. void Napis::Wypisz() const
  38. {
  39. cout << m_pszNapis;
  40.  
  41. /* int i = 0;
  42. while (m_pszNapis[i] != '\0')
  43. {
  44. cout << m_pszNapis;
  45. i++;
  46. }
  47. }
  48. */
  49. }
  50.  
  51. void Napis::Wpisz()
  52. {
  53. cin >> m_pszNapis;
  54. }
  55.  
  56. int Napis::SprawdzNapis(const char* por_napis) const
  57. {
  58. if (strcmp(m_pszNapis, por_napis) == 0)
  59. return 0;
  60. else if (strcmp(m_pszNapis, por_napis) > 0)
  61. return 1;
  62. else return -1;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement