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

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).

!"          !        

 

Posted Date: 3/20/2013 3:40:45 AM | Location : United States







Related Discussions:- How does c++ help with the tradeoff of security vs.usability, Assignment Help, Ask Question on How does c++ help with the tradeoff of security vs.usability, Get Answer, Expert's Help, How does c++ help with the tradeoff of security vs.usability Discussions

Write discussion on How does c++ help with the tradeoff of security vs.usability
Your posts are moderated
Related Questions
write an algorithm to swap values without using third variable


If an array holds integer, each of which is four bytes long, how many bytes from the base location of the array is the location of the fifth element?

Data is required to be fed into the program (input) and sent out of the program (output). Considering the draughtsman using a CAD station, the input is his commands to cause lines/

Custom Scans and Alerts Think or Swim Project Description: I am seeking somebody to make me several Custom Scans and Alerts on Thinkorswim TOS Skills required are C++ Prog

Is there any difference between List x; and List x ()? Can you please provide me assignment help.

Create a mathematical number guessing game. Have the user prompt for the number of games that they want to play. Then each game consists of the following rules. a. The computer

Operator overloading - c++ program: Write a program in c to define operator overloading. class matrix{                   private :                 int x[2][2];

Default Arguments A default argument is a value that is automatically assigned to a formal variable, if the actual argument from the function call is omitted. e.g. void

what is the difference between call by reference and call by pointer method?