Skip to content

Conversation

@stoyanK7
Copy link
Contributor

@stoyanK7 stoyanK7 commented Jul 13, 2024

What?

This PR fixes typos in chapter "9.4. C Pointers".

There is a mismatch between the expressions that the printf statements claim to show and the expressions they are actually showing.

Render

$ make asciidoctor -a toc=left book.adoc asciidoctor: WARNING: optional gem 'pygments.rb' is not available (reason: cannot load 'pygments'). Functionality disabled.

I don't have Ruby installed so no syntax highlighting.
Screenshot from 2024-07-13 15-47-02

@stoyanK7 stoyanK7 closed this Jul 13, 2024
@stoyanK7 stoyanK7 reopened this Jul 13, 2024
printf("\n This is arr[0]: %c ", arr[0]);
printf("\n This is *arr: %c ", *(arr+0));
//as well as:
printf("\n This is arr[0]: %c ", arr[1]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before

 This is arr[0]: h This is *arr: h This is arr[0]: e This is *(arr+0): e This is arr[1]: l This is *(arr+1): l This is arr[2]: l This is *(arr+2): l This is arr[3]: o This is *(arr+3): o This is 1[arr]: e 
printf("\n This is *(arr+2): %c ", *(arr+3));
printf("\n This is arr[3]: %c ", arr[4]);
printf("\n This is *(arr+3): %c ", *(arr+4));
printf("\n This is arr[1]: %c ", arr[1]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After

 This is arr[0]: h This is *arr: h This is arr[1]: e This is *(arr+1): e This is arr[2]: l This is *(arr+2): l This is arr[3]: l This is *(arr+3): l This is arr[4]: o This is *(arr+4): o 
Copy link
Collaborator

@syreal17 syreal17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, great catch!

@syreal17 syreal17 merged commit b6a9704 into picoCTF:master Jul 18, 2024
@stoyanK7 stoyanK7 deleted the 9.4_C-pointers_fix-typos-print-statements branch July 24, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants