This is my code:
struct first
{
char x;
int y;
};
first a[3]={{'a',1},{'c',2},{'b',3}};
struct second
{
first b[2];
int z;
};
second c={{a[0],a[1]},12};
Basically, when I'm assigning the second structure, the first element is supposed to be an array of the first structure type. So I am trying to put two elements a[0] and a[1] in it. But it shows the error:
ERROR CYAPA.CPP 12: Cannot convert 'first' to 'char'
ERROR CYAPA.CPP 12: Cannot convert 'first' to 'int'
What am I doing wrong? I am using Turbo c++ as it is what is allowed by our curriculum in India.
a[].