Crisis du jour: (Linux) Array Error
I finished a program which runs fine on my XP box (Dev C++), but when I compile it under Linux (G++), I get:
In constructor 'Inventory::Inventory()'
ISO C++ forbids assignment of arrays
struct key //Private within class
key *keyptr = new key;
Please tell me there is something short of re-writing my entire code to fix this. My program depends on that array for indexing of a file.
if (infile.is_open()) //Snippet of constructor
while (! infile.eof())
infile.read ((char *) &data, sizeof(data));
keyptr[rrn].invnbr = data.inv_nbr; //This is the culprit!
keyptr[rrn].recnbr = rrn;