|
From: Dane E. <DE...@pa...> - 2004-08-11 21:44:08
|
Hi all,
=20
Thank you in advance for any help that you can offer.=20
Im working on a basic program with a 'students class' When I try to
compile my crude code to ensure I have my basic files built, I get this
error:
=20
9 C:\Documents and Settings\densign\Desktop\Students\students.h
'string' is used as a type, but is not defined as a type.
=20
I have 3 files that Im using. They are: main.cpp, students.h, and
students.cpp.
Here is their code:
=20
//main.cpp
#include <string>
#include <iostream>
#include <stdlib.h>
#include <vector>
#include "students.h"
=20
using namespace std;
=20
//Functions
void DaneHeader();
=20
int main(int argc, char *argv[])
{
DaneHeader();
=20
system("PAUSE");=20
return 0;
}
=20
void DaneHeader()
{
cout << "\nDane Ensign" << "\nStudents App." << "\n**********\n\n";
_____________________
//students.h
class students
{
public:
students();
=20
private:
string fname;
string lname;
int scoreWin, scoreWord, scoreExcel, scoreAccess, scorePoint;=20
};
________________________
//students.cpp
#include <string>
#include <iostream>
#include <stdlib.h>
using namespace std;
#include "students.h"
=20
// default constructor
students::students()
{
fname =3D "First";
lname =3D "Last";
scoreWin =3D 0;
scoreWord =3D 0;
scoreExcel =3D 0;
scoreAccess =3D 0;
scorePoint =3D 0; =20
}
_________
=20
|