I have a listing in my document and some lines before it I'm inserting a figure, doing the following:
\begin{figure}[htbp]
\begin{center}
\includegraphics[scale=0.7]{filename.png}
\caption{Caption}
\label{fig:label}
\end{center}
\end{figure}
Unfortunately the figure is breaking the listing in two and I don't know how to avoid that. I tried changing the figure positioning, but I couldn't find a good looking solution.
EDIT:
The listing mentioned is a container for software code, like the following:
\begin{lstlisting}[language=C, label=lst, caption="Software", breaklines=true]
//my code here
\end{lstlisting}
\begin{figure}[ht!]. – Count Zero Sep 13 '11 at 10:13