function calling problem

 
Hi,
I have written an EA which consists of several function. The structure looks like:


...
init()
{}
deinit()
{}

start()
{
int x;
double y;

...
x=function1();
y=function2();
...
return(0);
}

int function1()
{
...
}

double function2()
{
...
}


when I try to compile it, an error occurs, saying that funcition1 and function2 are not defined....

where and how should I define them ?
does it tak any other declaration i.e. in start() section or in init() ?

btw - what shoul be entered into init() function ?
is it supposed to be always empty in EAs ?

best regards,

Marek
 
Take your sorce
int init()
  {
   return(0);
  }
 
int deinit()
  {
   return(0);
  }
 
int start()
  {
   int x;
   double y;
   x=function1(); 
   y=function2();
   return(0);
  }
 
int function1()
  {
   return(5);
  }
 
double function2()
  {
   return(3.14);
  }

and compile it. 0 errors, 0 warnings

IMHO You've missed right brace }

If You do not need for initialization/deinitialisation then don't use init()/deinit(). Remove they from source

Reason: