I am using C++Builder XE4. I am trying to compile some C code into a console application. The C file is large so I have tried to focus on the problem. The code sets up two structures and then tries to call a value which is failing.
struct ephloc
{
long first_item_ordinal;
long last_item_ordinal;
int days_per_record;
int items_per_record;
int total_records;
};
struct ephloc objs[15] = {
{ 641, 2210500, 8, 44, 50224},
{2210501, 3014088, 16, 32, 25112},
{3014089, 4043684, 16, 41, 25112},
{4043685, 4483148, 32, 35, 12556},
{4483149, 4809608, 32, 26, 12556},
{4809609, 5098400, 32, 23, 12556},
{5098401, 5349524, 32, 20, 12556},
{5349525, 5600648, 32, 20, 12556},
{5600649, 5851772, 32, 20, 12556},
{5851773, 6730696, 16, 35, 25112},
{6730697, 10849068, 4, 41, 100448},
{10849069,14967440, 4, 41, 100448},
{14967441,14967452, 401792, 8, 1},
{14967453,14967464, 401792, 8, 1},
};
The code below stops on [2] and shows the two errors below. How can I modify this code to make it work?
E2110: Incompatible type conversion (C++) The cast requested can't be done.
E2062 Invalid indirection (C++)
int LoadData( D, iobj, p, v )
double D;
int iobj;
double p[], v[];
{
int s;
//--Lots of code here--
s = objs[iobj][2];
//--more code here--
}