|
#pragma once
#define MAX_TITLE_SIZE 1024
#include <string.h>
#include <iostream>
class CMovie
{
public:
CMovie(void);
CMovie(char *sTitle);
CMovie(char *sTitle, int iReleaseYear);
virtual ~CMovie(void);
inline const char* const getTitle(void) const
{
return m_sTitle;
};
inline int getReleaseYear(void) const
{
return m_iReleaseYear;
};
inline bool operator< (const CMovie& rCMovie) const
{
return (strcmp(this->getTitle(), rCMovie.getTitle()) < 0);
};
/** @brief output operator overloading.
*/
friend std::ostream& operator<< (std::ostream& out, CMovie& rCMovie)
{
out <<rCMovie.getTitle()<<";"<<rCMovie.getReleaseYear();
return out;
};
private:
char m_sTitle[MAX_TITLE_SIZE + 1];
int m_iReleaseYear;
};
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Mohamed Kalmoua is a Microsoft Certified Solutions Developer (MCSD) with over a decade of programming experience. He creates software for the Windows platform using C#, WPF, ASP.NET Core, SQL and C++. Mohamed also loves to build websites using Wordpress and Google analytics.