top won't be for the internal nodes. So that name might confuse you.
you could pull the struct out of the class. Then you could re-use it for a linked list or something.
all that aside, what is the trouble?
constructor...all it should do is set top to nullptr, I think.
push .. start here. Temp = new stacknode, temp.next = top (notice how this will fix itself if top is null!), top = temp I think is what you want. Data = data of course, don't forget the data.
after you think you have push correct, try view(). If you get both of those working, view will display what you put into validate push. From there its more of the same...
The problem is I am not allowed to change the skeleton of the header file .
Plus , I have to provide all the functions here , then I have to call the header file in the main cpp .