# Using a language dialect in listings

I don't understand why the following document does not compile:

\documentclass[letterpaper, 11pt, onecolumn]{article}

\usepackage{lipsum}
\usepackage{listings}

\begin{document}
\lipsum[1]
\begin{lstlisting}[language=[11]C++]
struct test
{
int x = 0;
};
\end{lstlisting}
\lipsum[1]
\end{document}


Where is the problem?

[language=[11]C++] is an optional argument and [11] is another optional argument. In listings package, When using an optional argument inside another optional you need to use braces around the whole value.
\begin{lstlisting}[language={[11]C++}] ought to fix it.
If you check the listings documentation in Section 2.3 the third point in the \itemize explains it