Hi all,
This is my first time posting here and I am seriously hoping you guys could help me. I am doing this implementation of a stack class and for the life of me I cant get the copy constructor to work properly. It keeps returning invalid allocation size, but there are no negative numbers involved in anything here.
try posting the code you're trying to run too. There could be a simple hidden mistake in your main.cpp
EDIT: from what i see, your sizes variable has no use in the program. Your initial constructor never sets sizes to the int passed. Your sizes variable is just full of garbage at the moment because nothing was assigned to it.
I already found the problem thanks alot ^^. Basically i used sizes as a variable in the private part and as the name of the arguement. Caused it to randomnly spaz and give garbage as the value. Fixed it by changing the arguement name to sizes 2 and assigning its value to sizes. Btw that green comment was supposed to be the variables i defined in the private part. Just for my info can I mark this question as answered or something?