I would like to be able to present a C++ code snippet. I would like for this snippet to be captioned, referenced, and included in the Table of Algorithms generated by the algorithm2e
package. This is what I wish would work:
\begin{algorithm}
\caption{Hello.}
\label{alg:cbscppapi}
\begin{lstlisting}
[si, SB, qq, kk] = cbs_{grad,div}(kk);
[si, SB, qq, kk] = cbs_{grad,div}(kk, tau);
\end{lstlisting}
\end{algorithm}
But instead I get funky results:
Any hints?