注册 登录
编程论坛 C++教室

编译问题,求救!

niitp 发布于 2007-11-29 16:16, 541 次点击
#include <iostream>
class Customer
{
      private:
      char mobileNo[12];
      char name[25];
      char dateOfBirth[10];
      char billingAdd[50];
      char city[25];
      char phoneNo[13];
      float amountOutstanding;
      public:
      void print()
      {
           cout<<endl<<"Mobile phone number:";
           cout<<mobileNo<<endl;
           cout<<"Name:";
           cout<<name<<endl;
           cout<<"date of birth:";
           cout<<dateOfBirth<<endl;
           cout<<"Billing address:";
           cout<<billingAdd<<endl;
           cout<<"City:";
           cout<<city<<endl;
           cout<<"residence phone number:";
           cout<<phoenNo<<endl;
           cout<<"amount due:";
           cout<<amountOutstanding<<endl;
      }   
       void get()
       {
          cout<<"Mobile phone number:";
          cin>>mobileNO;
          cout<<endl<<"Name:";
          cin>>name;
          cout<<endl<<"Date of Birth:";
          cin>>dateOfbirth;
          cout<<endl<<"Billing Address:";
          cin>>billingAdd;
          cout<<endl<<"city";
          cin>>city;
          cout<<endl<<"Residence phone number:";
          cin>>phoneNO;
          cout<<endl<<"Amount due:";
          cin>>amountOutstanding;
         
                  
            }
      
};   
 int main()
 {
     Customer object;
     object.get()
     object.print()
     return 0;
}         



15 C:\Documents and Settings\ping\桌面\2ke.cpp `cout' undeclared (first use this function)
  (Each undeclared identifier is reported only once for each function it appears in.)



请问是什么问题!
4 回复
#2
无缘今生2007-11-29 16:47
如果你要用这个的话:
#include <iostream>
还要加上:using namespace std;

还有一种就是直接写成#include <iostream.h>
#3
csmenglei9512007-11-29 16:48
很多拼写错误,自己得仔细
#4
niitp2007-11-29 17:03
谢谢楼上两位~~问题解决了...

为什么我输入数据后还没显示就闪没了....
#5
beyond07022007-11-29 17:54
N 多错误
1