Computer Science, asked by Apnaschool, 5 days ago

Compare and contrast, structure and class. How will you make an array of structures, and an array of objects?
If a class nums is having 3 variables a,b and c, give the implementation of the class with functions for the following purposes, assuming all the variables to be private.
a) To initialize the members of the class unconditionally, ie without any parameter.
b) To initialize the members separately using suitable parameters.
c) To find out the average of 3 variables of the same type.
d) To print out all the values of all the variables.
e) To find out the biggest of the variable and to return it to the calling function.
f) To find out and to return the smallest of the variables, to the calling function.
g) To print the 3 variables in the sorted order.​

Answers

Answered by joymerlin2531
0

Answer:

Structure vs class in C++

In C++, a structure is the same as a class except for a few differences. The most important of them is security. A Structure is not secure and cannot hide its implementation details from the end-user while a class is secure and can hide its programming and designing details. Following are some differences between a class and a structure.

Similar questions