Thanks for the replies. I've been using your example now for a few days, but unfortunately I now need to expand on it.
Lets say my structure is used to store information of every house hold in a road so its like this:
Code:
struct infoAttr{
char Name[20];
int houseNumber;
};
infoAttr road1[3] = {
{"mike", 20},
{"Dave",23},
{"Alex", 22}
};
infoAttr road2[3] = {
{"Rich", 27},
{"Steve",13},
{"Andy", 29}
};
I want to combine the above array's into a 2d array called all roads like so
Code:
infoAttr allRoads[2][3] = {road1,road2};
However im getting the error message
Code:
error C2440: 'initializing' : cannot convert from 'struct infoAttr [3]' to 'char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Any ideas? Thanks :-)