Hello guys!
I just started with C development and I'm trying to make a C program wich will read some informations from a ".txt" file and make a Tree with some IDs.
Everything works fine, until the 35th line. When my file got more than 35 lines, my program doesn't even starts reading (Error: Process terminated with status -1073741819).
/* arv = my tree struct
** * a = pointer to my tree struct
** b[98] = the ID i want to insert
*/
arv *ins(arv * a, char b[98])
{
arv * q;
int num;
if (a == NULL)
{
q = (arv*) malloc (sizeof(char)*98);
strcpy(q->id,b);
q->left = NULL;
q->right = NULL;
a = q;
}
else
{
num = strcmp(b,a->id);
if (num < 0)
{
a->left = ins(a->left,b);
}
if (num > 0)
{
a->right = ins(a->right,b);
}
}
return a;
}
Do you think the problem is there?
Let me know if you need more info about the code.