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)?



This question was answered in the IRC channel.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.