المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : ارجوكم ساعدونييييييييي



al7elwah85
23-10-2005, 04:23 PM
Create a class DoubleSubscriptedArray. The class should be able to create an array containing any number of rows and any numbers of columns. The class should performs range checking to ensure that subscripts remain within the bounds of the array.

The class allows one array object to be assigned to another with the assignment operator. Objects of this array class know their size, so the size does not need to be passed separately as an argument when passing an array to a function. Entire arrays can be input or output with the stream-extraction and stream-insertion operators, respectively.

The class should provide operator() to perform double-subsripting operations. For example, in a 2-by-3 DoubleSupscriptedArray called a, the programmer could write a(1,3) to access the element at row 1 and column 3. The underlying representation of the double-subscripted array should be a single-subsripted array of integers with rows*columns number of elements.



Hint:

private:

int rows;

int columns;

int *ptr;



a(1,1)

a(1,2)

a(1,3)

a(2,1)

a(2,2)

a(2,3)

al7elwah85
23-10-2005, 04:29 PM
ما أدري ليه ما طلع الأراي مضبوط شكله على العموم هو كذا

a(1,1)

a(1,2)

a(1,3)

a(2,1)

a(2,2)

a(2,3)





بس بالعكس ما أدري ليه ما يطلع صح
يعني من اليسار الى اليمين أول خانة في المستطيل هي
a(1,1)f
أخر خانه هيa(2,3)f
الf بس علشان يصير شكل القوس صح

wellknownQ8
26-10-2005, 07:20 AM
--- السلام عليكم ---

اخي الكريم .. عند كتابتك للرد استخدم "الكود" و علامته كهذه http://images.montada.com/editor/code.gif

ثم ضع برنامجك بين الكلمتين CODE] و /CODE]


و بالتوفيق