The previous answer: listings 'escapeinside'-option is not working for me indicated that
escapeinside={@*}{*@)},
should allow me to escape inside a listing with @* ... *@
However in my listing, everything following the escape is then treated as LaTeX not listing:
// remove all multiples starting with @* $i^2$ *@
for (uint64_t j = i*i; j <= n; j += 2*i)
isPrime[j] = false;
so the for loop comes out wrong. If this is insufficient code, I will try to work up an MWE
)in your question. – user202729 Jan 18 '22 at 12:11)and the example works just fine for me. – daleif Jan 18 '22 at 12:12