How does c++ help with the tradeoff of security vs.usability, C/C++ Programming

Assignment Help:

A: In C, encapsulation was completed by making things static in a compilation unit or module. It prevented another module from accessing the static stuff. (Incidentally, now static data at file-scope is deprecated in C++: don't do that.)

Unluckily this approach doesn't support multiple instances of the data, as there is no direct support for making multiple instances of a module's static data. If multiple instances were required in C, programmers typically utilized a struct. But unluckily C structs don't support encapsulation. It exacerbates the tradeoff among safety (information hiding) and usability (multiple instances).

In C++, you can have multiple instances and encapsulation both via a class. The public part of a class has the class's interface, which normally contains the class's public member functions and its friend functions. The private or/ and protected parts of a class have the class's implementation, typically which is where the data lives.

 

The end result is similar to an "encapsulated struct." It decrees the tradeoff between  usability (multiple instances) and safety (information hiding).

!"          !        

 


Related Discussions:- How does c++ help with the tradeoff of security vs.usability

Net salary, please may i have a brief theory about a c++ program to find ne...

please may i have a brief theory about a c++ program to find net salary of employees

Define automatic storage classes - computer programming, Define Automatic s...

Define Automatic storage classes - computer programming? The Variables declared within function bodies are automatic by default and automatic variables are declared inside a fu

Algorithms flow charts and psuedocode, How to write C program (interest cal...

How to write C program (interest calculator) the simple interest on a loan is calculated by the formula interest=principal*rate*days/365; ?

C program to construct a structure , c program to construct a structure: ...

c program to construct a structure: struct sensus                 {                                 char name[30];                                 long int population;

Char, how many bytes required to char

how many bytes required to char

Flowcharts, push and pop operation using array draw flowcharts

push and pop operation using array draw flowcharts

Class and object, write a class player that contain attributes for the play...

write a class player that contain attributes for the player,s name,average and team

Explain looping statements, Looping Statements The statements usually u...

Looping Statements The statements usually used for looping are for, do-while, while. The goto statement can be used for looping, but its use is generally avoided as it leads to

Algorthrithm for c programe, Need algorithm for c programe #Minimum 100 wor...

Need algorithm for c programe #Minimum 100 words accepted#

Describe difference between malloc()/free() & new/delete?, for object, mall...

for object, malloc allocates memory in heap however doesn't invoke object's constructor to initialize the object. new allocates memory & also invokes constructor to initialize the

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd