#include <iostream>
#include <string>

using namespace std;

class SomeClass
{
public:
	void make_exception(const string &msg)
	{
	    err = "Error: ";
	    err += msg;
	    throw err.c_str();
	};	
private:
	string err;
};



int main(int argc, char *argv[])
{
	SomeClass obj;
	
	try {
		obj.make_exception("Test");
	} catch (const char *e) {
		cout << "Exception thrown with message: \"" << e << '"';
	}
}