Skip to content

Correct technical explanation for what p format specifier prints #26

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

Merged
merged 1 commit into from
May 26, 2024

Conversation

sb1752
Copy link
Contributor

@sb1752 sb1752 commented May 23, 2024

  • Provides a more accurate description of what the format specifier, p is printing. From my understanding this is the address of the heap location, and not the address of the pointer structure itself. This is why if you print the vec and the two slices, they will all return the same memory address. This is also why the memory address consistently updates by 4 after reading 4 bytes.
  • Included another diagram here to help visualize what is happening for mutable copy
  • Updated the diagram for mutable reference

@sb1752 sb1752 mentioned this pull request May 23, 2024
@sb1752 sb1752 changed the title correct technical explanation for what p format specifier prints Correct technical explanation for what p format specifier prints May 23, 2024
@edilmedeiros
Copy link
Contributor

ACK d120ba0

The diagrams are a huge improvement.
I believe you can merge this. Then, I'll close #25 and submit minor editing if I find any typos on top of main.

@sb1752
Copy link
Contributor Author

sb1752 commented May 26, 2024

Awesome thanks

@sb1752 sb1752 merged commit c0f4645 into main May 26, 2024
@sb1752 sb1752 deleted the chp9-memory-description branch May 29, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants