Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create swap.cpp #1591

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Create swap.cpp #1591

wants to merge 4 commits into from

Conversation

@helper-uttam
Copy link

@helper-uttam helper-uttam commented Sep 5, 2021

This program uses XOR bitwise and swap the values of 2 variables

Description of Change

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:
This program uses XOR bitwise and swap 2 values.

This program uses XOR bitwise and swap the values of 2 variables
Copy link
Member

@mishraabhinn mishraabhinn left a comment

@helper-uttam Proper Documentation and formatting needed. You can also have a look for previous successfully pr merged for reference. Thanks.
Refer

@helper-uttam
Copy link
Author

@helper-uttam helper-uttam commented Sep 5, 2021

@helper-uttam Proper Documentation and formatting needed. You can also have a look for previous successfully pr merged for reference. Thanks.
Refer

I had added documentation related with every line of code. Now if there anything left please let me know?

bit_manipulation/swap.cpp Outdated Show resolved Hide resolved
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Hey there! Thank you for submitting a PR! 😄 Sadly, this does not meet our requirements. Check out our repository standards. Please read them carefully and follow them. Also, check comments by @mishraabhinn. 🙂

not working
@helper-uttam
Copy link
Author

@helper-uttam helper-uttam commented Sep 6, 2021

can someone please suggest me some changes. Like assert(bit_manipulation::swap::swap_XOR(11, 2) == (2,11)); this require swap_XOR to return 2values but Is it possible to return two values from a function?

@mishraabhinn
Copy link
Member

@mishraabhinn mishraabhinn commented Sep 6, 2021

can someone please suggest me some changes. Like assert(bit_manipulation::swap::swap_XOR(11, 2) == (2,11)); this require swap_XOR to return 2values but Is it possible to return two values from a function?

Pass reference in the swap function instead of pointer and compare individual values using assert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants