I have a little lstlisting to show a snippet of code but since the code has % in it for modulo calculation the listing breaks down. How can I escape it?
I have tried the backslash, verbatim and \text
commands
\begin{lstlisting}
int RSAEncrypt(char m)
{
return (int)pow(charToNumber(m), e) % n;
}
\end{lstlisting}
lstlisting
inside another macro or pseudo-environment liketabularx
? Otherwise it should work fine as Seamus said. Please add a complete minimal example that illustrates your problem.