#include <iostream>
using namespace std;
enum word_lengths{ W16=1, W32, W64, W128, W256};
class CPU
{
private:
float frequency;
word_lengths wordlength;
float coefficient;
public :
CPU(float frequency=2.3, word_lengths wordlength=W64, float coefficient=1.8);
void run();
void stop();
~CPU(){cout<<"CPU析构函数!"<<endl;}
void show()
{
cout<<"主频(frequency):"<<frequency<<endl;
cout<<"字长(wordlength):";
switch(wordlength)
{
case 1: cout<<"W16"; break;
case 2: cout<<"W32"; break;
case 3: cout<<"W64"; break;
case 4: cout<<"W128"; break;
case 5: cout<<"W256"; break;
}
cout<<endl;
cout<<"倍频系数(coefficient):"<<coefficient<<endl;
}
};
CPU::CPU( float f, word_lengths wl, float c)
{
frequency=f;wordlength=wl ;coefficient=c;
cout<<"CPU构造函数!"<<endl;
}
void CPU::run()
{ cout<<"CPU开始运行!"<<endl;}
void CPU::stop()
{ cout<<"CPU运行结束!"<<endl;}
void main()
{ CPU p1; p1.run(); p1.show();
CPU p2(2.0,W16,3.0); p2.stop(); p2.show();
}

为什么没调用stop,会输出“cpu”运行结束?
using namespace std;
enum word_lengths{ W16=1, W32, W64, W128, W256};
class CPU
{
private:
float frequency;
word_lengths wordlength;
float coefficient;
public :
CPU(float frequency=2.3, word_lengths wordlength=W64, float coefficient=1.8);
void run();
void stop();
~CPU(){cout<<"CPU析构函数!"<<endl;}
void show()
{
cout<<"主频(frequency):"<<frequency<<endl;
cout<<"字长(wordlength):";
switch(wordlength)
{
case 1: cout<<"W16"; break;
case 2: cout<<"W32"; break;
case 3: cout<<"W64"; break;
case 4: cout<<"W128"; break;
case 5: cout<<"W256"; break;
}
cout<<endl;
cout<<"倍频系数(coefficient):"<<coefficient<<endl;
}
};
CPU::CPU( float f, word_lengths wl, float c)
{
frequency=f;wordlength=wl ;coefficient=c;
cout<<"CPU构造函数!"<<endl;
}
void CPU::run()
{ cout<<"CPU开始运行!"<<endl;}
void CPU::stop()
{ cout<<"CPU运行结束!"<<endl;}
void main()
{ CPU p1; p1.run(); p1.show();
CPU p2(2.0,W16,3.0); p2.stop(); p2.show();
}

为什么没调用stop,会输出“cpu”运行结束?