The function works, I put a cout in the function and it is getting the correct value,
but the cout in main() is still the original value of the variables
I declared my function in a header file
long gcd(long a, long b, long&x, long&y) it does not seem to matter if i have long &x, long& x or long&x
in my function file i have
long gcd(long a, long b, long&x, long&y) again the spacing doesnt seem to matter
{procedure}
in my main file
i have gcd(a,b,x,y)
and cout gcd(ab,x,y) << x << y and the x and y are not changed
even though a cout in the function file shows the function is working.
Is there another location that the "&" is needed?
The book i'm reading gives one simple example of reference, based on that, and websearches , everything looks hunky dorry, but it isnt working
i've included the files
nope, i guess not, the website wont allow .cpp extension in attachement or something
i hesitate to copy all the code, because it is quite long and in three files. but i will if asked

New Topic/Question
Reply



MultiQuote







|