Please help me understand what I'm doing wrong here.
Struct is
struct node
{
int value;
stack <int>losersStack;
};
Main is
int main()
{
int size;
printf("Enter size of arrary\n");
scanf("%d", &size);
node *arr = new node[size];
for(int i=0; i<size; i++)
{
printf("Enter a value\n");
scanf("%d", arr[i].value );
}
}
I get an error during the value entering. "Unhandled exception at 0x55e5effe (msvcr100d.dll) in blabla: 0xC0000005: Access violation writing location 0xcdcdcdcd."
Thanks in advance!