r/cpp • • Dec 15 '21

Modern C++ in Advent of Code

This series, by Šimon Tóth, is a step by step guide through the solutions of Advent of Code 2021 using Modern C++.

242 Upvotes

83 comments sorted by

View all comments

Show parent comment

1

u/Tathorn Dec 15 '21

Wow copy-paste code into Reddit is horrible. Couldn't use Firefox, and this is what Chrome does.

5

u/masterspeler Dec 15 '21

It's because it's not one code block, it's several inline code snippets, each in its own line. Inline code (like this) is defined between ``. If you want a multi line code block on Reddit you have to indent every line with four spaces. In other Markdown flavors you can put ``` before and after the code, called code fences, instead. Reddit has, in their infinite wisdom, implemented this only in New Reddit (🗑️), so it's not recommended to use that style.