#include <iostream>
using namespace std;
class father
{
private:
int a;
int b;
public:
int c;
int d;
protected:
int e;
int*p;
public:
void setA(int newA)
{
a=newA;
};
void showA(void)
{
cout<<a<<"father show A"<<endl;
}
};
class mother
{
private:
int a;
public:
void setA(int newA)
{
a=newA;
}
void showA(void)
{
cout<<a<<"mother show A"<<endl;
}
};
class Son:public father,public mother
{
public:
void func(void)
{
c=9;
e=10;
};
private:
int A;
void fuc11(void)
{
father::c=10;
};
};
int main(int argc, const char * argv[]) {
std::cout << "Hello, World!\n";
Son son;
son.father::setA(9999);
son.father::showA();
cout<<endl;
son.mother::showA();
cout<<sizeof(father)<<endl;
cout<<sizeof(son)<<endl;
return 0;
}
<script type="text/javascript">
$(function () {
$('pre.prettyprint code').each(function () {
var lines = $(this).text().split('\n').length;
var $numbering = $('<ul/>').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i <= lines; i++) {
$numbering.append($('<li/>').text(i));
};
$numbering.fadeIn(1700);
});
});
</script>