Nested functions are not in the C standard. It is a GCC extension, of a dubious value. Don't do it.
Casting
mallocis a bad practice. First, it is not necessary, and second, it may lead to a hard-to-find bugs.Along the same line, prefer
sizeof valuerather thansizeof (type), e.g.BTree* node = malloc(sizeof *node);Among other benefits, this avoids double maintenance.
isAVLBalancedseems buggy. It only tests the heights of immediate subtrees of the root. You also need the subtrees themselves to be AVL balanced - i.e. it also needs to be recursive.Stylistically,
*shall gravitate to a variable, not to the type. Preferstruct BTree *left;Disclaimer: this is a matter of an (heretical) opinion. You don't want to say that
leftis a pointer toBTree. You want to say that*leftin an expression yields aBTreeobject.