الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

تصحيح كود في ال Graph

بدأه شوشو-22 في 17 مايو 2010 · 2 رد · 530 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمه الله وبركاته

عندي سؤال عن الـ Graph

في فنكشن عندي فيها مشكله وأتمنى أحد يساعدني بمعرفتها وفهم الخطأ

void insertArc (Graph<station,int> &g)
{ 

	int k1,k2;

	/*station s1,s2;
       do{
       cout<<"   enter the ID of station move from it  \n";
       cin>>k1;
       }while(! g.retrieveVertex(k1,s1)=1);

       do{
       cout<<"  enter the ID of station arrive to it  \n";
       cin>>k2;
       }while(! g.retrieveVertex(k2,s2)=1);*/

       cout<<"   enter the ID of station move from it  \n";
       cin>>k1;
       cout<<"  enter the ID of station arrive to it  \n";
       cin>>k2; 

       if (g.insertArc(k1,k2)=1)
       cout<<"sucess insert \n";
       else
        if (g.insertArc(k1,k2)=-1)
       cout<<" cann't insert memory over fllow \n";
       else
        if (g.insertArc(k1,k2)=-2)
        cout<<"ID of station move from it not found \n";
        else
        if (g.insertArc(k1,k2)=-3)
        cout<<"ID of station arrive to it not found \n";

}

الخطأ دائما ً يطلع لي في السطور مثل

   if (g.insertArc(k1,k2)=-2)

لما اسوي مساواة لفنكشن بقيمه

مـآ الخطأ

جزاكم الله خيرا ً

#2

في المقارنه نستخدم == مرتين وليس =

1
tvquran_6.gif

#3
فهدالشلوي كتب:

في المقارنه نستخدم == مرتين وليس =

جزاك الله كل خير

مواضيع مشابهة