【发布时间】:2017-03-16 21:03:36
【问题描述】:
Cout 没有命名类型
伙计们,为什么我在使用“iostream and using namespace std”时仍会收到此错误
这是我的代码
class DateType: public PatientType{
cout<<"\nEnter Patient ID\n";
cin>>Patient_ID;
cout<<"\nEnter Patient's Age\n";
cin>>Age;
cout<<"\nEnter Patient's Date of Birth";
cin>>DOB;
};
DateType 类派生自 PatientType 类,PatientType 类派生自 PersonType 类。
cout 在任何地方都可以使用,但在 DateType 类中。
【问题讨论】:
-
你可能想得到a good book on C++。
-
你想做什么?您希望何时运行这些代码行?即使不使用继承也会出现同样的错误。
-
我的错,我假设我在函数中编写代码,但那是在课堂上
标签: c++ inheritance