Explain the difference between pass-by-value and pass-by-reference using a real-time programming example.