Advertisement
benjam62217

Untitled

Apr 18th, 2014
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #ifndef COW_H_
  2. #define COW_H_
  3.  
  4. #include <string>
  5.  
  6. class Cow
  7. {
  8. public:
  9.  
  10. Cow(std::string);
  11.  
  12. virtual ~Cow();
  13.  
  14. std::string Process();
  15.  
  16. private:
  17. std::string m_phrase;
  18. };
  19.  
  20. #endif /* COW_H_ */
  21.  
  22. ___
  23.  
  24. #include <iostream>
  25. #include <string>
  26. #include "Cow.h"
  27.  
  28. using namespace std;
  29.  
  30. Cow (string phrase)
  31. {
  32. m_phrase = phrase;
  33. }
  34.  
  35. string Cow::Process() //Cuts the string to 40 char lines
  36. {
  37. int i;
  38. i = m_phrase.size();
  39.  
  40. if (i > 40)
  41. {
  42. cout << "More than 40" << endl;
  43. }
  44. else
  45. {
  46. cout << "Less than 40" << endl;
  47. }
  48.  
  49. return 0;
  50. }
  51.  
  52. Cow::~Cow()
  53. {
  54. // TODO Auto-generated destructor stub
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement