title: Segmentation fault in constructor when using strcpy
body: <p>Hi guys I'm writing a program that reads NMEA sentences for a university assignment and I'm having trouble with segmentation fault. Can anyone help me fix it, please?</p>
  
  <pre><code>NmeaSentence::NmeaSentence(std::string sentence) {
      const char *temp = sentence.c_str();
      char *c_sent;
      strcpy(c_sent, temp);
      char *pch;
      for(int i = 0; i &lt; MAX_SENTENCE_PARTS; i++){
          pch = strtok(c_sent, ",");
          this-&gt;sentenceParts[i] = pch;
      }
      this-&gt;sentence = sentence;
      this-&gt;sentenceType = sentenceParts[0];
  }
  </code></pre>
  
  <p>The error seems to be happening at strcpy. What am I doing wrong?</p>