[Tex/LaTex] \verb illegal in command argument in task


Following this: Make two-columned list start at same line as its section, I did:




     \begin{tasks}[label = \textbullet](2)
        \task C{}\verb!++!.
        \task German (B1)
        \task Italian (A1)
        \task Greek (native)


which results in the error:

./foo.tex:14: LaTeX Error: \verb illegal in command argument.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.

l.14     \end{tasks}


I read this: How to put \verb command inside of \textbf{} block?, but was still unable to apply the solution, I tried:

\task \cprotect C{}\verb!++!.

but that resulted in:

Runaway argument?
{\task }{,label = \textbullet }{2} \task 
./foo.tex:10: Forbidden control sequence found while scanning use of \tasks.
<inserted text> 
l.10         \task \cprotect

How to fix this?

Best Answer

Use this:


But why not a simple C{}\texttt{++}?

Related Question