finding the first character in a word?

Hello, I am very new to c++ and I was wondering if anyone was able to help me out! Essentially, what my program needs to do is read a .txt file with a message and censor out "sensitive words" that are also provided in the same .txt. The specific function I am stuck on is called wordBeginsAt. The parameters/return value are as follows:

bool wordBeginsAt (const std::string& message, int pos)

in which the message being referenced is the one read from the file, and the character position is the int (but this was probably pretty clear)
This function is called within another function called censorMessage which I will post in the box below. If anyone can help me out and needs me to post the rest of the code I can definitely do that and thanks in advance to anyone reading!

1
2
3
4
5
6
7
8
9
10
11
12
  void censorMessage (string& msg)
{
  for (int i = 0; i < msg.length(); ++i)
    {
      if (wordBeginsAt(msg, i))
	{
	  string word = extractWord(msg, i);
	  if (isSensitive(word))
	    censorSentenceAt (msg, i);
	}
    }
}
Topic archived. No new replies allowed.