#include <iostream> 
#include <string>
using namespace std;

class MyString : public string
{
	public:
		MyString() : string() {}
		MyString(string s) : string(s) {}

		int MyFindChar(string s, char c) //return index of location of c in string s, otherwise return -1
		{
			int i;
			for (i = 0; i < s.length(); i++)
				if (s[i] == c)
					return i;
			return -1;
		}
};

int main()
{
	int k;
	MyString MyStr1;
	MyString MyStr2("My Red Book");

	k = MyStr1.MyFindChar("Hello, I am a pink box", 'x');
	cout << "index = " << k << endl;

	k = MyStr1.MyFindChar("Hello, I am a pink box", 'A');
	cout << "index = " << k;
}

