I have created the file rect.h it contains the following code:
class Rectangle
{
public:
Rectangle();
void relativeSize(double factor);
void changeLength(double num);
void changeWidth(double num);
void showSides(string color);
double area();
double perimeter();
double getLength();
double getWidth();
private:
double length;
double width;
}
I am getting an error on the function void showSides(string color). It is saying that 'string' is an undeclared identifier..why?
second. I have created an implementation file as well called rect.cpp. My header statements are this:
#include <iostream>
#include "rect.h"
using namespace std;
is this the proper way to do that? It is telling me that there is a missing ; before 'using'..
thanks
k
class Rectangle
{
public:
Rectangle();
void relativeSize(double factor);
void changeLength(double num);
void changeWidth(double num);
void showSides(string color);
double area();
double perimeter();
double getLength();
double getWidth();
private:
double length;
double width;
}
I am getting an error on the function void showSides(string color). It is saying that 'string' is an undeclared identifier..why?
second. I have created an implementation file as well called rect.cpp. My header statements are this:
#include <iostream>
#include "rect.h"
using namespace std;
is this the proper way to do that? It is telling me that there is a missing ; before 'using'..
thanks
k