#10062
AvatarDriton
Participant
    Up
    0
    Down
    ::

    Sorry, I am having issues showing nice layout code snippet in my comments.

    Copying code from Visual Studio or other applications to here in Editor (in Visual mode) does not show it as expected (as you showed us in last Q&A sessions). For me it shows only the plain text, without any formatting.

    Copying HTML code here in Editor (in Text Mode) shows the code correctly, as long as I am writing in Editor. After submitting my comment, the code loses its layout/formatting.

     

    I saw in your videos a blue bar saying about your account: “Your account has the ability to post unrescricted HTML content”.  Should you, maybe, activate this feature for us also?

     

    Thank you in advance!

     

    Code snippet below already lost its formatting/layout.

     

    <!– HTML generated using hilite.me –>
    <div style=”background: #f8f8f8; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;”>

    <span style="color: #8f5902; font-style: italic;">#include <iostream></span>
    <span style="color: #8f5902; font-style: italic;">#include <array></span>
    <span style="color: #8f5902; font-style: italic;">#include <vector></span>
    <span style="color: #8f5902; font-style: italic;">#include <set></span>
    <span style="color: #8f5902; font-style: italic;">#include <unordered_set></span>
    <span style="color: #8f5902; font-style: italic;">#include <algorithm></span>
    <span style="color: #8f5902; font-style: italic;">#include <iterator></span>
    <span style="color: #204a87; font-weight: bold;">template</span><span style="color: #ce5c00; font-weight: bold;"><</span><span style="color: #204a87; font-weight: bold;">typename</span> <span style="color: #000000;">C</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #204a87; font-weight: bold;">typename</span> <span style="color: #000000;">T</span> <span style="color: #ce5c00; font-weight: bold;">=</span> <span style="color: #204a87; font-weight: bold;">typename</span> <span style="color: #000000;">C</span><span style="color: #ce5c00; font-weight: bold;">::</span><span style="color: #000000;">value_type</span><span style="color: #ce5c00; font-weight: bold;">></span>
        <span style="color: #204a87; font-weight: bold;">void</span> <span style="color: #000000;">displayData</span><span style="color: #000000; font-weight: bold;">(</span><span style="color: #204a87; font-weight: bold;">const</span> <span style="color: #000000;">C</span> <span style="color: #ce5c00; font-weight: bold;">&</span><span style="color: #000000;">container</span><span style="color: #000000; font-weight: bold;">)</span> <span style="color: #000000; font-weight: bold;">{</span>
        <span style="color: #000000;">std</span><span style="color: #ce5c00; font-weight: bold;">::</span><span style="color: #000000;">copy</span><span style="color: #000000; font-weight: bold;">(</span><span style="color: #000000;">container</span><span style="color: #000000; font-weight: bold;">.</span><span style="color: #000000;">cbegin</span><span style="color: #000000; font-weight: bold;">(),</span> <span style="color: #000000;">container</span><span style="color: #000000; font-weight: bold;">.</span><span style="color: #000000;">cend</span><span style="color: #000000; font-weight: bold;">(),</span> <span style="color: #000000;">std</span><span style="color: #ce5c00; font-weight: bold;">::</span><span style="color: #000000;">ostream_iterator</span><span style="color: #ce5c00; font-weight: bold;"><</span><span style="color: #000000;">T</span><span style="color: #ce5c00; font-weight: bold;">></span><span style="color: #000000; font-weight: bold;">(</span><span style="color: #000000;">std</span><span style="color: #ce5c00; font-weight: bold;">::</span><span style="color: #000000;">cout</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #a40000; border: 1px solid #ef2929;">”</span> <span style="color: #a40000; border: 1px solid #ef2929;">“</span><span style="color: #000000; font-weight: bold;">));</span>
        <span style="color: #000000;">std</span><span style="color: #ce5c00; font-weight: bold;">::</span><span style="color: #000000;">cout</span> <span style="color: #ce5c00; font-weight: bold;"><<</span> <span style="color: #a40000; border: 1px solid #ef2929;">‘\</span><span style="color: #000000;">n</span><span style="color: #a40000; border: 1px solid #ef2929;">‘</span><span style="color: #000000; font-weight: bold;">;</span>
    <span style="color: #000000; font-weight: bold;">}</span>
    <span style="color: #204a87; font-weight: bold;">int</span> <span style="color: #000000;">main</span><span style="color: #000000; font-weight: bold;">()</span> <span style="color: #000000; font-weight: bold;">{</span>
        <span style="color: #204a87; font-weight: bold;">const</span> <span style="color: #000000;">std</span><span style="color: #ce5c00; font-weight: bold;">::</span><span style="color: #000000;">array</span> <span style="color: #000000;">myArray1</span><span style="color: #000000; font-weight: bold;">{</span><span style="color: #ce5c00; font-weight: bold;">-</span><span style="color: #0000cf; font-weight: bold;">10</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">5</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">1</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">4</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">5</span><span style="color: #000000; font-weight: bold;">};</span>
        <span style="color: #000000;">displayData</span><span style="color: #000000; font-weight: bold;">(</span><span style="color: #000000;">myArray1</span><span style="color: #000000; font-weight: bold;">);</span>
        <span style="color: #204a87; font-weight: bold;">const</span> <span style="color: #000000;">std</span><span style="color: #ce5c00; font-weight: bold;">::</span><span style="color: #000000;">array</span> <span style="color: #000000;">myArray2</span> <span style="color: #ce5c00; font-weight: bold;">=</span> <span style="color: #000000; font-weight: bold;">{</span><span style="color: #ce5c00; font-weight: bold;">-</span><span style="color: #0000cf; font-weight: bold;">10</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">5</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">1</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">4</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">5</span><span style="color: #000000; font-weight: bold;">};</span>
        <span style="color: #000000;">displayData</span><span style="color: #000000; font-weight: bold;">(</span><span style="color: #000000;">myArray2</span><span style="color: #000000; font-weight: bold;">);</span>
        <span style="color: #204a87; font-weight: bold;">const</span> <span style="color: #000000;">std</span><span style="color: #ce5c00; font-weight: bold;">::</span><span style="color: #000000;">vector</span> <span style="color: #000000;">myVector</span> <span style="color: #ce5c00; font-weight: bold;">=</span> <span style="color: #000000; font-weight: bold;">{</span><span style="color: #ce5c00; font-weight: bold;">-</span><span style="color: #0000cf; font-weight: bold;">10</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">5</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">1</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">4</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">5</span><span style="color: #000000; font-weight: bold;">};</span>
        <span style="color: #000000;">displayData</span><span style="color: #000000; font-weight: bold;">(</span><span style="color: #000000;">myVector</span><span style="color: #000000; font-weight: bold;">);</span>
        <span style="color: #204a87; font-weight: bold;">const</span> <span style="color: #000000;">std</span><span style="color: #ce5c00; font-weight: bold;">::</span><span style="color: #000000;">set</span> <span style="color: #000000;">mySet</span> <span style="color: #ce5c00; font-weight: bold;">=</span> <span style="color: #000000; font-weight: bold;">{</span><span style="color: #ce5c00; font-weight: bold;">-</span><span style="color: #0000cf; font-weight: bold;">10</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">5</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">1</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">4</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">5</span><span style="color: #000000; font-weight: bold;">};</span>
        <span style="color: #000000;">displayData</span><span style="color: #000000; font-weight: bold;">(</span><span style="color: #000000;">mySet</span><span style="color: #000000; font-weight: bold;">);</span>
        <span style="color: #204a87; font-weight: bold;">const</span> <span style="color: #000000;">std</span><span style="color: #ce5c00; font-weight: bold;">::</span><span style="color: #000000;">unordered_multiset</span> <span style="color: #000000;">myUnorderedMultiSet</span><span style="color: #000000; font-weight: bold;">{</span><span style="color: #ce5c00; font-weight: bold;">-</span><span style="color: #0000cf; font-weight: bold;">10</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">5</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">1</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">4</span><span style="color: #000000; font-weight: bold;">,</span> <span style="color: #0000cf; font-weight: bold;">5</span><span style="color: #000000; font-weight: bold;">};</span>
        <span style="color: #000000;">displayData</span><span style="color: #000000; font-weight: bold;">(</span><span style="color: #000000;">myUnorderedMultiSet</span><span style="color: #000000; font-weight: bold;">);</span>
     <span style="color: #204a87; font-weight: bold;">return</span> <span style="color: #0000cf; font-weight: bold;">0</span><span style="color: #000000; font-weight: bold;">;</span>
    <span style="color: #000000; font-weight: bold;">}</span>
    

    </div>