Question
c++ please show steps Create a class out of the structure privatizing the data and adding setter and getter functions. Main.cpp /* * File: main.cpp
c++ please show steps Create a class out of the structure privatizing the data and adding setter and getter functions.
Main.cpp
/* * File: main.cpp * Author: * Created on February 13th, 2019, 1:30 M * Purpose: */
//System Libraries Here #include
//User Libraries Here #include "Triangle.h"
//Global Constants Only, No Global Variables //Like PI, e, Gravity, or conversions
//Function Prototypes Here Trngl *fillStr(int); void prntStr(Trngl *); void destroy(Trngl *);
//Program Execution Begins Here int main(int argc, char** argv) { //Set the random number seed srand(static_cast
//Exit return 0; }
void destroy(Trngl *tri){ for(int row=0;row
void prntStr(Trngl *tri){ cout< Trngl *fillStr(int n){ //Allocate a structure to hold the Matrix Trngl *tri=new Trngl; //Create the 2-D allocated pointer tri->data=new int*[n]; for(int row=0;row Triangle.h /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: Triangle.h * Author: * * Created on February 13, 2019, 1:56 PM */ #ifndef TRIANGLE_H #define TRIANGLE_H struct Trngl{ int size; int **data; }; #endif /* TRIANGLE_H */
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started