there should be only one star for data in function parameters, like thisbool push(Elements **Stack, void *data);
Two stars means pointer to pointer, which is not what you want
bool push(Elements **Stack, void *data)
{
Elements *elem = new Elements;
if (!elem)
return false;
elem -> data = data;
elem -> next = *Stack;
*Stack = elem;
return true;
}
Now you call the above like this:
char* somedata = "Something";
Elements* head = 0;
push(&head,somedata);