# How to center listings caption?

I would like to know how to center the listings gerenated caption in LaTeX. It always go to the left of the code. The rest of the captions (tables) are OK.

\documentclass[11pt,a4paper,oneside, onecolumn]{IEEEtran}
\usepackage{listings}
\begin{document}
\begin{lstlisting}[caption={Exemplo de uso da função CorelDB.},label={list1}]
fileName = 'CorelGCH.arff';
features = CorelDB(@NormalizedGCH);
dlmwrite(fileName, features, ',');
\end{lstlisting}
\end{document}


I think the problem is with the IEEEtran...

-
From LaTeX Community: Cannot align caption to the center, you need the conference option added to your \documentclass line. –  Mike Renfro Jul 2 '12 at 13:59
That works. And I found that: \usepackage[justification=centering]{caption} Works too. –  CaioMendes Jul 2 '12 at 14:05
Consider answering your own question (two ways, yours and Mike Renfro's) and accepting your answer. Then the question won't appear on the list of those needing attention. You earn some reputation that way too. –  Ethan Bolker Jul 2 '12 at 14:59
Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. –  Jubobs Mar 1 at 22:36
To center the caption in the class IEEEtran you have two possibilities:
1. Load the class with the option conference. This was discussed at LaTeX Community: Cannot align caption to the center,
2. Load the package caption with the option justification=centering:
\usepackage[justification=centering]{caption}