pass be reference versus pass by value
Hello all,
I am new to C++, and have a quick ?, I am having trouble understanding what is the diffrence between pass by reference and pass by value??
I've read pass by reference is better as it'll make a copy of the parameter so that the orginal will not be altered, but by value will allow the the original to be altered?? it this correct or do I have it the other way around?? I'm just not getting this concept?? could someone please explain( and which one is more dangerous), I really new to C++ so want to make sure I completely understand all the basic concepts.....
also, by reference: int function (int parameter)?? is this correct with the &....
many thanks