Range.h:9: error: expected `)' before "s"
main.cpp: In function `int main()':
main.cpp:10: error: no matching function for call to `Range::Range(std::string)'
Range.h:6: note: candidates are: Range::Range(const Range&)
Range.h:8: note: Range::Range()
Process terminated with status 1 (0 minutes, 0 seconds)
2 errors, 0 warnings
I get the same error message either way. I'm no expert lol, bit isn't just two equivalent ways to typecast? If I remove it all together I get the error:
main.cpp:10: error: no matching function for call to `Range::Range(const char[4])'
instead, so my initial code did change the type. (compared to: main.cpp:10: error: no matching function for call to `Range::Range(std::string)')
(string)"Hej"
may work but string data type has already a constructor which takes constchar* as argument.
I suggest you to use constructors rather than type casts.