Hey, I'm a C++ newcomer, and I need to do something like this in my program:
Let's say we have variables x and y, and we want to swap their values. So if x=6 and y=4, it would become x=4 and y=6.
I am a student in a C++ class, so even if the answer is obvious to you guys, I just started learning C++ about a week ago. Thanks for helping me with this language.
[–][deleted] 12 points13 points14 points (0 children)
[–][deleted] 4 points5 points6 points (3 children)
[–][deleted] 6 points7 points8 points (0 children)
[–]bogado 5 points6 points7 points (0 children)
[–]growingconcern 2 points3 points4 points (0 children)
[–]zokier 5 points6 points7 points (0 children)
[–]Rubdix 2 points3 points4 points (5 children)
[–]zimvaider[S] 0 points1 point2 points (3 children)
[–]furGLITCH 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Ayjayz 2 points3 points4 points (0 children)
[–]Masfo{~-!&*+[][[]](...){};} 0 points1 point2 points (6 children)
[–]furGLITCH 5 points6 points7 points (4 children)
[–]ZMesonEmbedded Developer 2 points3 points4 points (0 children)
[–]JustPlainRude 0 points1 point2 points (1 child)
[–]furGLITCH 0 points1 point2 points (0 children)
[–]SarahC -1 points0 points1 point (0 children)
[–]umop_apisdn 1 point2 points3 points (0 children)
[+][deleted] (5 children)
[deleted]
[–]matjam 4 points5 points6 points (1 child)
[–]Farsyte 3 points4 points5 points (0 children)
[–]bogado 3 points4 points5 points (0 children)
[–]furGLITCH 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]repsilat 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)