I have coded a class blockbuster and namespace cs52. Would the proper way to create an object be
1) cs52::Blockbuster b( 100, "Rambo", "Sylvester Stallone" );
2.)std::Blockbuster b( 100, "Rambo", "Sylvester Stallone" );
or something different?
Code:
#include <string>
using namespace std;
namespace cs52 {
class Blockbuster{
public:
Blockbuster( int length, string title, string star );
friend bool equal( const Blockbuster & b1, const Blockbuster & b2 );
int getLength();
string getTitle();
string getPlace();
void setTitle( string title );
void setPlace( string place );
void setLength( int length );
private:
int my_Length; // feature length in minutes
string my_Title; // feature title
string my_Star; // leading actor or actress
};
}
Also, I actually didn't define my c++ file functions yet. Would be implemented as bool Blockbuster::equal(const Blockbuster & b1, const Blockbuster & b2)
or would I need to include friend somewhere in the declaration?