Barra simples de impressão de látex, barra invertida r, barra invertida n

Quero que a seguinte linha dentro de um arquivo * .tex seja impressa "como está":

while (tmp[0] == '\r' || tmp[0] == '\n') {tmp++;}

Quando envolvo-o em um comando \ verb como este:

\verb"while (tmp[0] == '\r' || tmp[0] == '\n') {tmp++;}"

não funciona, e eu recebo:

! Undefined control sequence.

Todas as outras respostas do google sãotão complicado.

Certamente, tem que haver uma maneira fácil de fazer isso, certo? Obrigado!

EDITAR:

Aqui está o exemplo mínimo de contador solicitado nos comentários:

%%%%%%%%%%%%%%%%%%%%%%%%%%
% document class: beamer %
%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{beamer}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% no navigation bars please %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{footline}[frame number]{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% no navigation symbols please %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{navigation symbols}{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% no footers at all please %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{footline}{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
% center the title please %
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{frametitle}[default][center]

%%%%%%%%%%%%%%%%%%
% begin document %
%%%%%%%%%%%%%%%%%%
\begin{document}

%%%%%%%%%
% title %
%%%%%%%%%
\title{Some Title}   

%%%%%%%%%%
% author %
%%%%%%%%%%
\author{Some Author}

%%%%%%%%%%%%
% date ... %
%%%%%%%%%%%%
\date{\today} 

%%%%%%%%%%%%%
% frame ... %
%%%%%%%%%%%%%
\frame{\titlepage} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SECTION :: Introduction %
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Section Introduction} 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Frame Title :: Introduction %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\frame{\frametitle{Status}
%%%%%%%%%%%%%%%%%%
% Items :: Begin %
%%%%%%%%%%%%%%%%%%
\begin{itemize}
\item
while (tmp[0] == 'A' $||$ tmp[1] == 'B') $\{$tmp++;$\}$
\end{itemize}
}
\end{document}

questionAnswers(1)

yourAnswerToTheQuestion