I new to c++ and dont know alot so plz bare with me.
Im trying to do this code out of C++ for Dummies and i though i done everthing right. (cant be to hard just copy the text right?)
Well I am getting a error of "In file include from main.cpp" on line 4 of main.cpp
this is the main.cpp
Code:
#include <iostream>
#include <stdlib.h>
#include <string>
#include "pen.h"
using namespace std;
int main( int argc, char *argv[])
{
This is the pen.h
Code:
#include <string>
using namespace std;
enum color {blue, red, black, clear};
enum penstyle {ballpoint, felt_tip, fountain_pen};
class pen {
public:
color inkcolor;
color shellcolor;
color capcolor;
penstyle style;
float lenght;
string brand;
int inklevelpercent;
void writeonpaper(sting words){
if (inklevvelpercent <=0 ) {
cout << " ........ out of ink!" << endl;
}
else {
cout << words << endl;
inklevelpercent = inklevelpercent - words.length();
}
}
void breakinhalf() {
inklevelpercent = inklevelpercent / 2;
length = length / 2.0;
}
void runoutofing() {
inkleelpercent = 0;
}
};
Is it giveing me a error on line 4 in the main. I can only assume it has some thing to do with the pen.h. Thank you for any help or input you give. If you need more information just say.