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

help me plz

مغلق
بدأه reem-12 في 24 أكتوبر 2004 · 5 رد · 632 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

want to write a program usint the pointer operations and recursion

plz help me because i try to solve it but i faild to have the corect answer

this is my question and i hope that u can help me before monday

----------------------------------------------------------------------------------

Write a recursive function named Comma_Separated that takes as parameters a pointer to char listptr which represents string1 and a pointer to char textptr which represents string2.The function should copy string1 into string2 but all the characters in string 2 should be separated by comma. The prototype of the function is:

void Comma_Separated (char *listptr, char *textptr);

NOTE: Use pointer operations and recursion only

for example :

The value before calling the function are:

String1="ITCS102", String2=" "

The value after calling the function will be:

String1="ITCS102", String2="I,T,C,S,1,0,2,"

i need ur help plz

#2

السلام عليكم

أتمنى أن ترفقي محاولاتك أختي ريم ،،حتى نستطيع مساعدتك ...

#3

أختـي أنا برنامج البورلاند سي بلاس بلاس لا يفتح بجهاز

كل ما حاولت فتحه تظهر لي رساله في مضمونها ان The system

file does not suitable for running MS-DOS and Micresoft windos

application فلا استطع كتابة البرنامج وبحاجه ماسه له لتقديمه يوم الاثنين

واعتذر للاطاله

#4

السلام عليكم

انا ماحب الوندوز بس استخدمه لأني مجبور وملزوم (الجامعة والبحوث معظمهم على الوندوز) المهم اختي ريم حاولي التالي:

روحي الى Start ثم RUN واكتبي

C:\WINDOWS\repair

اذا انفتح المجلد..انسخي (copy )

  • config.nt
  • autoexec.nt

الى مجلد Windows/system32

واعيدي تشغيل الجهاز او اعيدي تشغيلي Borland وبلتوفيق ان شاء الله.

اقتباس
Write a recursive function named Comma_Separated that takes as parameters a pointer to char listptr which represents string1 and a pointer to char textptr which represents string2.The function should copy string1 into string2 but all the characters in string 2 should be separated by comma. The prototype of the function is:

void Comma_Separated (char *listptr, char *textptr);

NOTE: Use pointer operations and recursion only

for example :

The value before calling the function are:

String1="ITCS102", String2=" "

The value after calling the function will be:

String1="ITCS102", String2="I,T,C,S,1,0,2,"

ريم حاولي انج تقرين البوينتر الي بيكون متوجه نحو string1 ثم سوي له loop علشان يقراء الأرقام وبعدين تضيفين كوما وبعدين يبتدي ال loop يقراء البوينتر مره ثانيه علشان يضيف كومه ثانيه وهكذا الي ان مايبقى شي ويتوقف ال loop.

تم تعديل هذه المشاركة بواسطة mustang في 30 أكتوبر 2004 في 05:48

#5

السلام عليكم

هذا احد حلولي القديمه لبرنامج يشبه مطلوبك

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

وانا لم انتبه لموضوعك الا اليوم

#include <iostream.h>
#include <conio.h>

void Comma_Separated (char *listptr, char *textptr);
void Comma_Separated (char *listptr, char *textptr)
{

cout<<"\nstring 2:";
 while(*listptr !='\0')
 {
 *textptr=*listptr;
 cout<<*textptr<<',';
 textptr++;
 listptr++;
 }

 }
 void main()
 {
 char str[50];
 char* str1;
 char*str2;
 cout<<"Entr ur string :";
 cin>>str;
 str1=str;
 str2= new char;
 Comma_Separated (str1, str2);
 getch();
 }
#6

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

اشكر كل من رد على موضوعي

واشكرك اخي على ارفاق الحل ولكن انا

احتاجه بلغة السي وليس السي بلاس بلاس وجربت اشتغل عليه

ولكن يعطيني غلط فيه ،، ولا اعرف اذا طريقتي صحيحه او لا

اتمنى افادتي وهذا الحل اللي حاولت فيه

zhe.txt

هذا الموضوع مغلق.

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