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
if age of ram,shayam and ajay are input through keyboard,write a program to determine the youngest of the three.

Depreciation to a salvage value of 0. For tax purposes an item may be depreciated over a period of several years, n. With the straight line method of depreciati

Return by reference: The return value of the function must be an address variable.  In following program the function returns the value of x or y and their types are declare

should i put define constant and memory constant in my flowchart? the other one, how to draw flowchart for break and continue statement?

Problem Write a program in C++ to read N numbers in an array, the user should be able to search a particular number in the array using sequential search algorithm. Writing a

A Constructive Example Consider an example , to model a user-defined data type for  strings. The object simulates a character array ( string ) using a character pointer and an

Explain about the strategies of implementation of the statecharts, Database Management System?

A: This is a name that acts as an alias, or alternative name, for a beforehand defined variable or an object. prepending variable along with "&" symbol makes it as reference. fo


1. The management of a company would like to determine the median annual salary of its employees.Write a pascal program that display the number of employees and their median salary