I'd like to insert a block of code in an enumerate list, but I don't want the natural indent from enumerate with the block. For example,
\begin{enumerate}
\item Primitive Version
\begin{enumerate}
\item Implementation
\paragraph{} The key segment of code is:
\begin{lstlisting}[style=ccode]
int main()
{
cout << "hello world" << endl;
}
\end{lstlisting}
\end{enumerate}
\end{enumerate}
I've checked several solutions such as No indentation for non-item within itemize but all of them resulted in errors as I cannot use lstlisting as a parameter.
! Illegal parameter number in definition of \lst@insertargs.
How should I achieve this? Thanks in advance.


\documentclassand the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Sep 21 '16 at 05:48