I have a project to finish ...... and for this i need a char ***a to get all the words that reffer to the dictionary names from a text file (for a translator). My program always breakpoints on the strcpy(a[line][v[i]], p); I'm stuck numar_cuvinte = word_number linie = line
while (!feof(dictionary_list))
{
fgets(buffer, 100, dictionary_list);
p = strtok(buffer, "-.\n");
while (p != NULL)
{
if (p != "txt")
{
nr_cuvinte++;
p = strtok(NULL, "-.\n");
}
else
p = NULL;
}
v[linie] = nr_cuvinte; // ---------> v[i] = nr cuvinte pe linie
nr_cuvinte = 0;// ----->m
linie++; // --->n
}
//-------------------------------------------------------------------------
a = (char***)malloc(linie*sizeof(char**));
for (int i = 0; i < linie; i++)
{
a[i] = (char**)malloc(v[i] * sizeof(char*));
}
for (int i = 0; i < linie; i++)
{
for (int j = 0; j < v[i]; j++)
{
a[i][j] = (char*)malloc(20 * sizeof(char));
}
}
//--------------------------------------------------------------------------
rewind(dictionary_list);
linie = 0;
nr_cuvinte = 0;
while (!feof(dictionary_list))
{
fgets(buffer, 100, dictionary_list);
p = strtok(buffer, "-.\n");
while (p != NULL)
{
if (p != "txt")
{
strcpy(a[linie][v[nr_cuvinte]], p);
nr_cuvinte++;
p = strtok(NULL, "-.\n");
}
else p = NULL;
}
v[linie] = nr_cuvinte;
nr_cuvinte = 0;// ----->m
linie++; // --->n
}
}