In C++,
struct info
{
int lazy,sum;
}tree[4*mx];
Initialize :
memset(tree,0,sizeof(tree))
That means
tree[0].sum is 0 and tree[0].lazy is 0 ...and so on.
Now I want to initialize different value like this:
tree[0].sum is 0 and tree[0].lazy is -1 .... and so on.
In For loop
for(int i=0;i<n;i++) // where n is array size
{
tree[i].sum=0;
tree[i].lazy=-1;
}
but in memset function I can't initialize structure array with different value. is it possible ??
std::fill.