I was looking up the stack, and trying to implement it in an array, and came across this code:
void push(STACK *ps, int x)
{
if (ps->size == STACKSIZE) {
fputs("Error: stack overflow\n", stderr);
abort();
} else
ps->items[ps->size++] = x;
}
I know what it all does, except the "->" part. In Wikipedia (where I found the code), it say; "It is responsible for inserting (copying) the value into the ps->items[] array and for incrementing the element counter (ps->size)".
So does the "->" symbol mean "copying to"? Because in the code, it seems like it's taking the size of STACK, and comparing it to STACKSIZE, rather than copying it to it. I realize this is C code, but I was also wondering if such a symbol exists in C++.
Thanks