I'm trying to do something fairly simple (I thought), but my Borland C++ 5.5 compiler doesn't like it. I want to declare a method in my class that will return a string value. Here's a SIMPLIFIED example of what I'm talking about:
#ifndef _MESSAGE_H
#define _MESSAGE_H
#include "stdlib.h"
#include <string>
class message{
public:
message();
~message();
string getText(); <-------
private:
string text; <-------
};
#endif
The two lines marked with arrows give me trouble. I recieve errors along the lines of "Expecting a type name". It seems that strings are not recognized as a type in this context. What am I doing wrong?
#ifndef _MESSAGE_H
#define _MESSAGE_H
#include "stdlib.h"
#include <string>
class message{
public:
message();
~message();
string getText(); <-------
private:
string text; <-------
};
#endif
The two lines marked with arrows give me trouble. I recieve errors along the lines of "Expecting a type name". It seems that strings are not recognized as a type in this context. What am I doing wrong?