title: Check if a string of type char * contains another string
body: <p>I have a larger task of which contains this function. Here are the instructions;</p>
  <blockquote>
  <p>Define a C ++ function named isPartOf , with two parameter pointers to C strings
  (ie of type char * ,  not from the not yet detailed declared C ++ data
  type string ) and returns a Boolean value.</p>
  <p>In essence, the function should check whether the string pointed to it
  by the first parameter pointer, is part of the string pointed to it by the
  second parameter pointer.</p>
  <p>Examples: isPartOf (&quot;heart&quot;, &quot;hypertensive
  heart disease&quot;) returns true back isPartOf (&quot;screw&quot;, &quot;Case Involving
  wheelchair&quot;) returns false back.</p>
  </blockquote>
  <p>I have been learning C for a year and have only begun learning C++ and I am finding it hard to understand the use of 'char *' and parameters in general. It took me awhile to understand pointers and now parameters have thrown me off. I have tried this code with probably all possible iterations of * and &amp; just to see if it will work but it does not.</p>
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  void isPartOf(char *, char *);
  
  int main()
  {
      char * Word;
      char * Sentence;
  
      cout &lt;&lt; &quot;Please enter a word: &quot;;
      cin &gt;&gt; Word;
      cout &lt;&lt; endl &lt;&lt; &quot;Please enter a sentence: &quot;;
      cin &gt;&gt; Sentence;
      cout &lt;&lt; endl;
  
      isPartOf(Word, Sentence);
  
      if (isPartOf(Word, Sentence))
      {
          cout &lt;&lt; &quot;It is part of it&quot;;
      }
      else
      {
         cout &lt;&lt; &quot;It is not part of it&quot;;
      }
  }
  
  void isPartOf(char a, char b)
  {
  
  }
  </code></pre>
  <p>My two main questions here are;</p>
  <ol>
  <li>How do parameters work in this case?</li>
  <li>Is there a function that will check if a string exists in a string? If not, how should I start going about coding a function of the sort?</li>
  </ol>