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

Decoding, Smugglers are becoming very smart day by day. Now they have devel...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Stand-alone dsp application, You are required to write a stand-alone DSP ap...

You are required to write a stand-alone DSP application in the C programming language. The overall objective of this application is to convert a signal from the time domain to t

Programming, what is the first thing I need to know about Programming?

what is the first thing I need to know about Programming?

Help me for an programming contest .., Pebble Merchant Problem Description...

Pebble Merchant Problem Description There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides

Can i drop the [] while deleteing array of some built-in , Can I drop the [...

Can I drop the [] while deleteing array of some built-in type (char, int, etc)? A: No. you can't Sometimes programmers think that the [] in the delete[] p only present so the

Change to palindrome, convert string s into palindrome by doing character r...

convert string s into palindrome by doing character replacement

Wap to print the largest number from any 10 numbers, WAP TO PRINT THE LARGE...

WAP TO PRINT THE LARGEST NUMBER FROM ANY 10 NUMBERS #include stdio.h> #include conio.h>   void main()   {                    int a[10],i,max;

Tell what the derived class inherits or doesn''t inherit?, Tell what the de...

Tell what the derived class inherits or doesn't inherit? A: Inherits: - All data member defined in the parent class (even though such members might not always be accessible

Procedure-oriented programming, E v o l u t i o n of Software: ...

E v o l u t i o n of Software: In the past stage of programming the software's were developed in Machine language Using binary numbers 1's and 0's.  Later it convert

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