0

Hi, I'm just starting out with programming in C++, and would like some clarification on something..

What is the meaning of the '&' in this line:

void Stack::push(const StackElement & value);

I would assume that it takes a reference as a parameter, however, why is it that it works when I pass a constant or a regular variable into it, like say, push(1), or push(x)?

Thanks,

kreb

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by sarehu
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.