answersLogoWhite

0


Best Answer

In C++, data is not secured from the outside world it is merely protected from accidental mutation. A determined programmer can easily circumvent the encapsulation of an object. Consider the following:

class X {

int data; // private by default

};

Here, the data member is declared private (the default access for a class), however the class definition exposes the implementation details making it possible to define the exact same class with public access under a different name:

struct Y {

int data;

};

Given that X and Y both have the same memory layout, it is trivial to undermine the encapsulation of an X by casting to a Y:

void f (X& x) {

x.data = 42; // error: x.data is private

Y& y {(Y&) x}; // refer to x as if it were really a Y with pubic access

y.data = 42; // ok

}

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How data secured from out side world in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is client server approach of c plus plus?

Client/server programs typically employ multi-threading where the primary thread handles the server side of things while one or more threads handle the client side.


Which errors tend to be more serious client side or server side?

Server side errors are more serious than client side errors. Client side errors deal with the manipulation of data that has already been transferred to the user. Because of this, the user may be unable to complete the task he or she wanted to, but the data will remain available for them to try again after you've fixed the error or they have tried another browser in which the error doesn't exist.Server-side errors, however, prevent the data from being sent out properly. They can expose security issues on the server, and they effect everyone trying to access the data, every time.The difference in analogous to a newspaper. If the delivery man makes an error, the paper may be unreadable, but it's only going to be unreadable to the individuals whom he serves (client side.) If the printers make an error, every newspaper will contain that error. This effects everyone who buys the paper (server-side.)


Compare user side and server side factor that can influence website performance?

Hard drive data speed, bandwidth, ram memory, and CPU processor speed are all factors that influence website performance on the user side and server side.


If you have a circuit with one battery What happens to the voltage and amperage when you add another battery plus side to minus side to the circuit?

read the boring science book


How do you print characters up and down in c plus plus vs. side to side?

Place a newline (linefeed) character ('\n') after each character you print. Depending on the device you may need a carriage return as well ('\r'). Usually the carriage return comes before the linefeed, but can often be treated as a string of two characters ("\r\n").

Related questions

Do you turn H plus on your Samsung Infuse?

Hold the lock button on the side and click the data plan option


What side lost in world war?

Germany Plus Italy and Japan (WW2).


What is a baby bouncer?

A baby bouncer is a device into which a baby may be secured while allowing him or her to bounce up and down, or from side to side.


What side of a battery is plus?

The plus side of the battery has a NIPPLE on it. The negative side of the battery is flat. Hope this helps


Which side of a CD contains the data?

the shiny side/smaller ring inside has the data coz u could put a cover on the other side


Does the printed side of a CD contain data?

No the side with the data is the non printed side simply because there is less for the read/write head of the drive to see through when moving data onto or off the disk


What should the anchor line be secured to before the anchor is thrown over the side of a vessel?

the bow cleat


What is the formula for perimeter of a tiragle?

Perimeter of a triangle = (length of the first side) plus (length of the second side) plus (length of the third side)


Where is the data port on a 1997 Dodge Intrepid?

The data link connector is under the dash on the driver side.The data link connector is under the dash on the driver side.


What is formula of finding the perimeter of a triangle?

Perimeter of a triangle = (length of the first side) plus (length of the second side) plus (length of the third side)


In a Pentium the front side data bus is how many bits wide?

For the Pentium the front side data bus is 64 bits wide. The back side is 32 bits wide.


Use to compare data side by side which of the following object should you select?

TableChartOutlineGrid