I've defined a subclass of std::string in 'mstring.h' and the main program in 'main.cpp'
mstring.h contains the full class definition (as follows) and main.cpp contains an #include "mstring.h" command, yet I recieve over 100 errors telling me theres no such class as MSTRING. I feel I am doing something very simple very wrong, can anyone spot the mistake!?
Thanks in advance.
mstring.h contains the full class definition (as follows) and main.cpp contains an #include "mstring.h" command, yet I recieve over 100 errors telling me theres no such class as MSTRING. I feel I am doing something very simple very wrong, can anyone spot the mistake!?
Thanks in advance.
Code:
/////////////// // mstring.h // /////////////// class MSTRING : public std::string { public: bool contains(MSTRING txt) { if (txt.empty()) return true; else return (this->lcase().find(txt.lcase()) != npos); } MSTRING lcase(MSTRING i) { MSTRING r(i); std::transform(r.begin(), r.end(), r.begin(), tolower); return r; } . . . more code . . . } ////////////// // main.cpp // ////////////// #include <windows.h> #include <iostream> #include <psapi.h> #include <shlobj.h> #include <vector> #include <cctype> #include <string> #include <algorithm> #include "mstring.h" . . . lots more code . . .
Comment