5 times "local function definitions are illegal"
Hi everybody !
This is my first post and I hope I can deal with the forum well.
I'm working on a program which currently has 7 errors in total. They aren't many but most of them are "local function definitions are illegal"
The awkward is I've those errors mainly in function which are given by the lecturers.
Code:
struct ELEM
{ int key2,pole; ELEM *left, *right;}
*root1, *root2 ;
ELEM *search_iter(ELEM *t, int k) //
{
while ((t!=NULL)&&(t->key2!=k))
if (t->key2<k)
t=t->right;
else
t=t->left;
return t;}
error C2601: 'search_iter' : local function definitions are illegal
calling :
if(search_iter(root1,NOMER)!=1)
........
My goal below is to go throw the elements and write in "pole" 0 .
Code:
void Available(ELEM *t, int n)
{
if ((t!=NULL)&&(t->key2==n)
{
t->pole=0;
preorder(t->left);
preorder(t->right);
}
}
Error :
'Available' : local function definitions are illegal
Later I'll post some more errors.
Any ideas ?