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

مشروع مستشفى...

بدأه a-s-m في 16 أبريل 2008 · 7 رد · 853 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

ادي مشروع خاص بالمستشفى وهو مشروع دراسي مبتدئ

مطلوب فيه عدة أمور من ضمنها id

The ID of the patient is a single string composed of two parts: a two-character code specifying the department he registered at (e.g. CR for Cardiology, OR for Orthopedics, NU for Neurology.. etc) and a serial number, which, unlike the code, is generated by the system.

كتبت هالكود

string id;

Patient::Patient(string fullName,string code)
{
 index=0;
 if (isalpha(fullName))
name=fullName;


 char array[10];
  printf(array,"%d",srId);
 id=array+code;
 idlen=id.length();
 while (idlen<=5)
  id=strcat('0',id);
 srId++;
  }

استخدمت دالة strcat

لكي تحدد لي عدد المنازل

أرجو تتبعها وايضاح هل هي صحيحة ام لا

جزى الله خيرا من اعارني بعض وقته

تم تعديل هذه المشاركة بواسطة a-s-m في 16 أبريل 2008 في 20:25

#2

السلام عليكم

استفسار اخر

 Visit& Visit:: operator=(const visit& v)
 {
  maxMedications=v.getmaxMedications();
  delete[] prescription;//becuase it is pointer in att.
  prescription=new string [v.getmaxMedications];
  //*prescription=v.prescription[v.getmaxMedications];
  for (int i=0;i<maxMedications;i++)
   prescription=v.prescription;
  return *this;
 }//related copy cons

يطلع لي خطا

C:\Program Files\Microsoft Visual Studio\MyProjects\lab project\visit.cpp(38) : error C2228: left of '.getmaxMedications' must have class/struct/union type

C:\Program Files\Microsoft Visual Studio\MyProjects\lab project\visit.cpp(43) : error C2228: left of '.prescription' must have class/struct/union type

أرجو الايضاح

#3

getmaxMedications ؟

يجب ان تكون classاوstructاو union

llback.jpg

اشهد ان لا إله إلا الله وان محمدا ً رسول الله

#4

time1

جزاك الله خير

بس ممكن توضيح أكثر

انا اريد النسخ

انتبهت للأقوس دالة الget

فوضعتها ولكن لم يتغير شي حاولت إزالة الget

ووضعت المتغير مباشرة نفس الأمر

أرجو الايضاح أكثر

شاكرة لك مرورك

#5

تأكدي من ان تعريف الصف visit صحيح

llback.jpg

اشهد ان لا إله إلا الله وان محمدا ً رسول الله

#6

time1

الله يسهل عليك دنيا وآخره

حولت عيوني كنت كاتبه بsmallوهي cabital

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

#7

طمعانه في كرمكم

....<<<<<<<<<<

لدي مشروع خاص بالمستشفى وهو مشروع دراسي مبتدئ

مطلوب فيه عدة أمور من ضمنها id

The ID of the patient is a single string composed of two parts: a two-character code specifying the department he registered at (e.g. CR for Cardiology, OR for Orthopedics, NU for Neurology.. etc) and a serial number, which, unlike the code, is generated by the system.

كتبت هالكود

string id;

Patient::Patient(string fullName,string code)
{
 index=0;
 if (isalpha(fullName))
name=fullName;


 char array[10];
  printf(array,"%d",srId);
 id=array+code;
 idlen=id.length();
 while (idlen<=5)
  id=strcat('0',id);
 srId++;
  }

استخدمت دالة strcat

لكي تحدد لي عدد المنازل

أرجو تتبعها وايضاح هل هي صحيحة ام لا

جزى الله خيرا من اعارني بعض وقته

تم تعديل هذه المشاركة بواسطة a-s-m في 16 أبريل 2008 في 20:32

#8

مساء مليء بالأكواد

كود اخر يحتاج من يشيك عليه

<<<

Visit& Visit:: operator=(const Visit& v)
 {
  maxMedications=v.getmaxMedications();
  delete[] prescription;//becuase it is pointer in att.
  prescription=new string [v.getmaxMedications()];
  //*prescription=v.prescription[v.getmaxMedications];
  for (int i=0;i<maxMedications;i++)
   prescription=v.prescription;
  return *this;
 }//related copy cons

C:\Program Files\Microsoft Visual Studio\MyProjects\lab project\visit.cpp(40) : error C2662: 'getmaxMedications' : cannot convert 'this' pointer from 'const class Visit' to 'class Visit &'

كيف ما يستطيع تحويله

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