I need to send a variable of this structure type from master processor to slave processor.

Code:
struct single_ant
{
long tour_length;
long *tour;
long *visited;
};
I used this code which returns the MPI datatype for the above structure:

Code:
MPI_Datatype Init_Type_Ants (struct single_ant ant[],int n)
{
MPI_Datatype Ants;
int base;
MPI_Aint disp[3];
MPI_Datatype type[3] = { MPI_LONG, MPI_LONG, MPI_LONG };
int blocklen[3] = { 1, n, n };

MPI_Address(ant,disp);
MPI_Address(ant[0].tour,disp+1);
MPI_Address(ant[0].visited,disp+2);
base=disp[0];
int i;
for(i=0;i<3;i++)
{
disp[i]-=base;
}
MPI_Type_struct (3, blocklen, disp, type, &Ants);
return Ants;
}
But this isn't working. Can anyone tell me what is wrong with this?
Or is there any other way I can implement this?