Is reading from a struct faster then reading from a class in c++?

Viewed 57

The following two classes are absolutely equivalent in every way except their name:

struct s
{
   int x;
};

class c
{
public:
   int x;
};

Is there a difference in speed between reading from a struct then a class?

For example,

is

int y = s.x

Slower then

int z = c.x

to run? Is one of them less efficient to read from?

0 Answers
Related