Have a REAL good look at what you're doing in this method.Code:void record::setp_number(int number) { number = p_number; }
Have a REAL good look at what you're doing in this method.Code:void record::setp_number(int number) { number = p_number; }
From what I understand so far (which I grant you is not that much) that should be about right. I've put in variable "number" input from main and assigned p_number that value. Obviously this isn't totally right as it is not working. Do I have to do something like passing by reference or have I got something in the syntax wrong because now I am just lost.
Thanks you all for your help on this though
Compare the code for the setp_number function that you wrote in post #1 with the code you posted in post #15. In particular, what are you assigning to, and why?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
got it!
I think I need to re read the parts of my book on the assignment operator and assigning values to variables. I thought that number = p_number and p_number = number would have been the same but then of course = does not mean equals == does.
Thanks for your patience and help in getting this sorted and I love the way you guys just didn't tell me how to fix it straight out but get me to think.
Once again thankyou antred, Jim and Laserlight