I am writing code form different languages in one document. Because of that it would be nice, if it is possible to display the name of the language below the rule of an lstlisting.
This is my code
\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}
\lstset{
% backgroundcolor=\color{},
commentstyle=\color{green},
keywordstyle=\color{blue},
stringstyle=\color{black!50!green},
% identifierstyle=\color{red},
numbers=left,
captionpos=t,
showstringspaces=false,
tabsize=2,
frame=b,
breaklines=true,
xleftmargin=17pt,
framexleftmargin=17pt,
}
\begin{document}
Much text
\begin{lstlisting}[language=C++]
#inlcude <iostream.h>
int end = 5;
for(int i = 0; i < end; i++)
{
std::cout << "Hello world!";
}
\end{lstlisting}
%This should happen automaticly
%----------------------------------------------------
\begin{flushright}
c++
\end{flushright}
%----------------------------------------------------
\end{document}