I am trying to cast an int value in a struct to a double. I am guessing I am screwing up the parenthesis somehow. I wasn't able to find anything useful in the forum or in google.
struct START
{
int x;
int y;
double heuristic;
};
struct SHAPES
{
int x [100];
int y [100];
double heuristic [100];
int has_visited [100];
int num_points;
int *link;
};
struct LINE
{
int x1 [100];
int y1 [100];
int x2 [100];
int y2 [100];
};
double addition(double x, double y)
{
return x + y;
}
int main(int argc, char *argv[])
{
int kk = 0;
double x = 0;
double y = 0;
double z = 0;
struct START start;
struct END end;
struct SHAPES shapes[100];
struct LINE edges;
x = (double)start.x;
y = (double)edges.x1[kk];
z = addition((double)start.x, (double)edges.x1[kk])
return 0;
}