#include<iostream.h>
class cpu{
public:
cpu(){
clockrate=1000;
chacter=32;
pit=4;
s=false;
}
void show(){
cout<<"时钟频率"<<clockrate<<endl;
cout<<"字长:"<<chacter<<endl;
cout<<"核数:"<<pit<<endl;
if(s){
cout<<"是否支持线程:是"<<endl;
}
else
cout<<"是否支持线程:否"<<endl;
cout<<"该类所占的字节数"<<sizeof(cpu)<<endl;
}
private:
int clockrate:4;
int chacter:4;
int pit:4;
bool s:1;
};
int main(){
cpu p;
p.show();
return 0;
}
class cpu{
public:
cpu(){
clockrate=1000;
chacter=32;
pit=4;
s=false;
}
void show(){
cout<<"时钟频率"<<clockrate<<endl;
cout<<"字长:"<<chacter<<endl;
cout<<"核数:"<<pit<<endl;
if(s){
cout<<"是否支持线程:是"<<endl;
}
else
cout<<"是否支持线程:否"<<endl;
cout<<"该类所占的字节数"<<sizeof(cpu)<<endl;
}
private:
int clockrate:4;
int chacter:4;
int pit:4;
bool s:1;
};
int main(){
cpu p;
p.show();
return 0;
}