LearnCpp.com now supports Markdown for comment formatting!
Markdown is a simple-to-use syntax used to apply formatting to text that is typed in a text editor or textbox. It is similar to HTML, but is designed to be easier to type and more human-readable.
|Syntax||To bold text, you’d type:|
|HTML||This text should be <strong>bold</strong>|
|Markdown||This text should be **bold**|
Supported Markdown on LearnCpp
|Formatting||If you type this in the comment form||It will display like this
when the comment is submitted
|Bold||This is **bold** text||This is bold text|
|Underline||This is ___underlined___ text||This is underlined text||Opening/closing ___ must be preceded/followed by whitespace|
|Inline code||Don’t forget to `#include <iostream>`||Don’t forget to
||Can be used in the middle of a sentence
Uses backticks (`), not single quotes (‘)
|Opening and closing ``` must be on separate line
Uses backticks (```), not single quotes (”’)
Can also use tildes (~~~)
If you’re already familiar with Markdown syntax already, you can type Markdown formatting directly into the comment form.
Using the Quicktag buttons
If you’re not familiar with Markdown syntax, you can use the Quicktag buttons above the comment form. These buttons will insert the appropriate Markdown formatting for you.
If you’re not sure what a Quicktag button does, hover over it to see the tooltip that describes its function.
What’s the difference between inline code and a code block?
Inline code is designed to display a snippet of code as part of an existing sentence. It is normally used to highlight a variable or function name, or display a single line of code.
A code block is designed to display an entire program. It uses the syntax highlighter to make the code easier to read.
If this didn’t answer your question, or if something above wasn’t clear, please leave a comment below and we’ll fix it.