I allocate a dynamic array of characters using pointer, and it gets run time exception?
<p>I wrote the following code, but when I allocate word in memory it gets NULL!
where is the problem with the following code? I forced to write in this why to split the lite into words :( please any help</p>

<pre><code>void strSplit(const char *line, char *words[]){

    char *word = new char[81];
    int index = 0;
    int s = strlen(line);
    for(int i = 0; i &lt; s; i++)
    {
        if(line[i] != ' ' &amp;&amp; line[i] != ',' &amp;&amp; line[i] != ';')
        {
            if(word == NULL)
            {
                strcpy(word, (line[i] + "\0"));
            }
            else 
            {
                strcat(word, (line[i] + "\0"));
            }
        }
        else
        {
            if(word != NULL){
                strcpy(words[index], word);
                puts(words[index]);
                index++;
                puts(word);
                word = NULL;
            }
        }

    }
}
</code></pre>
