السلام عليكم ورحمة الله
ممكن أحد منكم يصحح الخطأ بالكود الي صلحته
لكم جزيل الشكر..
</B></DIV> <DIV><B>#include <iostream>
#include <string>
using namespace std;</B></DIV> <DIV><B>class Mobile{
private:
string colour;
static const string make;
const string model;</B></DIV> <DIV><B>public:
Mobile(string c, string m): model(m)
{
colour = c;
}</B></DIV> <DIV><B> void display()
{
cout << "colour: " << colour << ", make: " << make;
cout << ", model: " << model << "\n";
}</B></DIV> <DIV><B> void ring()
{
cout<< "ring! ring! ring!"<< endl;
}</B></DIV> <DIV><B>
void changeColur(string c){
colour = c;
}</B></DIV> <DIV><B> friend bool issame(Mobile m,Mobile m2);</B></DIV> <DIV><B>};
//****************************************
bool issame(Mobile m,Mobile m2)
{
return (m.model == m2.model);
}
const string Mobile::make="Nokia";
//*****************************************
class Owner{ friend class Mobile;
string name;
//Mobile mobile;</B></DIV> <DIV><B> Owner(string n, string mo,string cl): mobile(cl,mo) </B></DIV> <DIV><B> Mobile& getMobile(){</B></DIV> <DIV><B> return mobile;}
void print(){
cout<<"name is: "<<name<<endl;
}</B></DIV> <DIV><B> mobile.disply();
};
//****************************************
int main()
{
cout<<"Mobile class"<<endl;
cout<<"------------"<<endl<<endl;</B></DIV> <DIV><B> Mobile b1("silver", "6600");
Mobile b2("Red", "5020");
issame(b1,b2);
system("pause");
return 0;
}</B></DIV><B> <DIV> </DIV> <DIV>
<B></B>