• 0
  • مالي خلق
  • أتهاوش
  • متضايق
  • مريض
  • مستانس
  • مستغرب
  • مشتط
  • أسولف
  • مغرم
  • معصب
  • منحرج
  • آكل
  • ابكي
  • ارقص
  • اصلي
  • استهبل
  • اضحك
  • اضحك  2
  • تعجبني
  • بضبطلك
  • رايق
  • زعلان
  • عبقري
  • نايم
  • طبيعي
  • كشخة
  • النتائج 1 إلى 4 من 4

    الموضوع: كيف يتغل البرنامج

    1. #1
      التسجيل
      21-09-2004
      الدولة
      UAE
      المشاركات
      60
      المواضيع
      17
      شكر / اعجاب مشاركة

      Unhappy كيف يتغل البرنامج

      كود:
      #include <iostream.h>
      
      void mystery1(char *,const char *);
      
      int main ()
      {
       char string1[80];
       char string2[80];
      
       cout<<"enter two string :";
       cin>>string1>>string2;
       mystery1(string1,string2);
       cout<<string1<<endl;
      
       return 0;
      
      }
      
      void mystery1(char *s1, const char *s2)
      {
       while(*s1 != '\0')
        ++s1;
      
       for(;*s1=*s2;s1++,s2++)
        ;
      }
      كيف هذا البرنامج يشتغل ممكن حد يشرح لي ,,, وشكرا ,,,
      The Choice you make Today
      Will usually Affect Tomorrow

    2. #2
      التسجيل
      16-08-2002
      الدولة
      الفضاء الخارجي
      المشاركات
      34
      المواضيع
      11
      شكر / اعجاب مشاركة

      مشاركة: كيف يتغل البرنامج

      اخوي ممكن تخبرني وش المطلوب للبرنامج واساعدك
      لان الكود مادري وش المقصود
      من البرنامج حيرني

    3. #3
      التسجيل
      16-05-2004
      الدولة
      Cairo, Egypt
      المشاركات
      141
      المواضيع
      2
      شكر / اعجاب مشاركة

      مشاركة: كيف يتغل البرنامج

      ok, this is a really nice piece of code..it could have been writen in much simpler way
      mainly it concatenates two strings together
      it reads two strings, pass their address to a function(which is the address of the first charcter of th string, now the function increaments the address of the first string untill it reaches the end of th word(this is th while loop) in the for loop, it simply copies the second string to the first string charcter by charcter
      so the end result is that the first string contains both words beside each other
      و الجهل زاد فى البتاع, لا مقرى ولا منقول...

    4. #4
      التسجيل
      11-04-2002
      الدولة
      سوريا
      المشاركات
      760
      المواضيع
      76
      شكر / اعجاب مشاركة

      مشاركة: كيف يتغل البرنامج

      اقتباس المشاركة الأصلية كتبت بواسطة amgadpasha
      ok, this is a really nice piece of code..it could have been writen in much simpler way
      mainly it concatenates two strings together
      it reads two strings, pass their address to a function(which is the address of the first charcter of th string, now the function increaments the address of the first string untill it reaches the end of th word(this is th while loop) in the for loop, it simply copies the second string to the first string charcter by charcter
      so the end result is that the first string contains both words beside each other
      فقط أريد أن أضيف أن عمل الحلقة while في التابع mystery1 هو إيجاد المحرف الصفري في المصفوقة الأولى ( يعني نهاية الجملة ) و الحلقة for كما قال الأخ amgadpasha .
      لا إله إلا الله
      مشروع لتعليم أساسيات لغة الـ ++C :
      -
      موضوع لتعليم الفيجوال بيسك 6 :

    ضوابط المشاركة

    • لا تستطيع إضافة مواضيع جديدة
    • لا تستطيع الرد على المواضيع
    • لا تستطيع إرفاق ملفات
    • لا تستطيع تعديل مشاركاتك
    •