MLUG: [MLUG] c++ complier error in redhat 9.0/help
[MLUG] c++ complier error in redhat 9.0/help
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> it work for this one
> but have prg like this
> # include <iostream>
> # include <fstream>
> using namespace std;
> using namespace std;
> using char std;
> class Customer
> {
> private:
>  char mobileNo[11];
>  char name [25];
>  char dateofBirth [9];
>  char billingAddress [51];
>  char city [25];
>  char phoneNo [11];
>  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<< "Customer's billing address: ";
>    cout<< billingAddress << endl;
>   cout<< "City: ";
>   cout<< city << endl;
>   cout<< "Resident Phone number: ";
>   cout<< phoneNo << endl;
>   cout<< "Amount due: ";
>   cout<< amountOutstanding << endl;
>  }
>  void get()
>  {
>   cout << "Mobile phone number: ";
>   cin >> mobileNo;
>   cin.ignore();
>   cout << endl << "Name: ";
>   cin.getline(name,25);
>   cout << endl << "Date of Birth: ";
>   cin >> dateofBirth;
>   cin.ignore();
>   cout << endl << "Customer's billing address: ";
>   cin.getline(billingAddress,51);
>   cout << endl << "City: ";
>   cin.getline(city,25);
>   cout << endl << "Residence phone number: ";
>   cin >> phoneNo;
>   cout << endl << "Amount due: ";
>   cin >> amountOutstanding;
>  }
> };
> int main ()
> {
>  Customer object;
>  fstream file;
>  char reply = 'Y';
>  file.open ("customer.dat",ios::out|ios::app);
>  while(reply == 'Y' || reply == 'Y')
>  {
>   cout << "Enter Customer details " <endl;
>   object.get();
>   file.write((char *)&object,sizeof(object));
>   cout << "Do you wish to continue ?[y/n]";
>   cin >> reply;
>  }
>  file.close();
>  file.open ("customer.dat",ios::in);
>  file.read((char *)&object, sizeof(object));
>  while(file)
>  {
>   object.print();
>   file.read((char *)&object, sizeof(object));
>  }
>  file.close();
>  return 0;
> } 
> 
> when compiling i get
> 
> std::basic_ostream<char,std::char_traits<char>>&<<unknown type>'operator
> 
> what may be solution
> ----- Original Message ----- 
> From: "Russell Horn" <EMAIL:PROTECTED>
> To: "'MLUG Members'" <EMAIL:PROTECTED>
> Sent: Thursday, May 15, 2003 12:57 AM
> Subject: RE: [MLUG] c++ complier error in redhat 9.0/help
> 
> 
> > Following up to my own post, I had meant to include the c++ stuff too.
> > 
> > If you're using c++ you should have a file called helloworld.cpp
> > 
> > It would contain:
> > 
> > #include <iostream> // no .h or anything here
> > using namespace std;
> > 
> > int main() {
> >   cout << "Hello, World!";
> > }
> > 
> > 
> > You should be able to compile this using
> > 
> > ~> g++ helloworld.cpp
> > 
> > And run your program with:
> > 
> > ~> ./a.out
> > 
> > 
> > Hope that helps,
> > 
> > Russell.
> > 
> > _______________________________________________
> > members mailing list
> > EMAIL:PROTECTED
> > http://mlug.missouri.edu/mailman/listinfo/members
> 
> _______________________________________________
> members mailing list
> EMAIL:PROTECTED
> http://mlug.missouri.edu/mailman/listinfo/members

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members