السلام عليكم
ادي مشروع خاص بالمستشفى وهو مشروع دراسي مبتدئ
مطلوب فيه عدة أمور من ضمنها 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
لكي تحدد لي عدد المنازل
أرجو تتبعها وايضاح هل هي صحيحة ام لا
جزى الله خيرا من اعارني بعض وقته
