| xoden (2) | |||||
|
Hello, i'm new to the site so sorry if i mess something up. my program doesn't seem to work. the final cout in the main doesn't show that the numbers switched. it seems to call the function just fine
output is:
but it should be:
| |||||
|
Last edited on
|
|||||
| Texan40 (446) | |
|
If you want to actually alter a and b pass in references instead: void swap(int &a, int &b); Right now you're passing in a value that doesn't remain after the call to swap() | |
|
|
|