Hello,

i am developing a software for wordCount; i have done all the functions neccessary;

I get segmentation fault when i try and run this :

int main()
{
char* str = (char*)malloc(100);
str[0] = 'T';
str[1] = 'e';
str[2] = 's';
str[3] = 't';
str[4] = 0;

itemType item = buildItem(str);
BSTreeADT treeTest = createBSTree();
treeTest = insertItem(item, treeTest);
displayOccurrences(treeTest);
inOrderTree(treeTest);
printf("%d\n", noOfItems(treeTest));
printf("%d\n", height(treeTest));
printf("%d\n", noOfItems(treeTest));
displayItem(leastItem(treeTest));
//First test all other functions
//then insert/remove some other items and call above functions again
str[0] = 'T';
str[1] = '2';
str[2] = 0; //'\0'
treeTest = insertItem(buildItem(str), treeTest);
}


any ideas?

thanks