Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a code in c++ Exercise 1: (10 points) A dobble pointer is used for declaring two dimenival amass dynumically. Fer cumple, We wait so

write a code in c++
image text in transcribed
Exercise 1: (10 points) A dobble pointer is used for declaring two dimenival amass dynumically. Fer cumple, We wait so inplenent a triangular 20 amay in which each nuw has soc colunn geater than the previve one. ie., the fins row has one colum, the scoond one hastwocolume, and the thind one las tree colaris and so on. You huve to take the lotal merber of nows foen the aner. Fage 3.2 shows an example of a tringelar 2D array with fex nows. Figure 3.2 Write following finction with peven prolotype: a. void AdtColunns (int o i, int aizes) The inction takes a sivjle poister by reference and dyramicaly alocals memary to it. Yoe will call this finction in main to alhcate narber of colunns be each now tum by tam. int maind it lat **pr Page 14 Lab Manual of Obest Orictha Proganines b. void Rowisetnpat (int *, int sizel This finction simply takes a poitier as an arpenert and takes iput in t foen the wer. The second arganent is the sire of ID amay poited by poiter. c. watd Rowbiseftint tint * Int stiel This finction takes a pointer as argument and griks is coetent. The secoed argenent is the sie of 1D aray poited by poeter. d. Ine main 0 In man faction yer have to do the folowing task: 1) Ask the wiser to criter the number of rows. 2) Declure a 2D array. 3) Alocate menvry for is colures in the array wirg Adocelume Funtine defined abore. 4) Take input in the 2D anny ung RonWbelnpat finction. 5) Prim the 2D armay aseg RowWisePrint finction 6) You may we bope in mai. 7) No gobal sarabkes are alkwed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions