Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

class

Status
Not open for further replies.

treds

Programmer
Oct 24, 2002
1
GB
hi

can anybody help i am having problems wiht this class and am not sure what the problem is i get a debug error 'missing ; before identifier description'

can any body help

#ifndef SALESTRAN_H
#define SALESTRAN_H

class SalesTran
{
private:
string description;
double price;
int units;
public:
SalesTran() {}

SalesTran(const string& d, const double p, const int u)
{
description = d;
price = p;
units = u;
}
};

#endif

cheers

Nick
 
Methinks you need to include
<string> and /or <iostream> and use namespace std

#ifndef SALESTRAN_H
#define SALESTRAN_H

#include <string>
#include <iostream>
using namespace std;



class SalesTran
{
private:
string description;
double price;
int units;
public:
SalesTran() {}

SalesTran(const string& d, const double p, const int u)
{
description = d;
price = p;
units = u;
}
};

#endif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top