title: A proper way to create a matrix in c++
body: <p>I want to create an adjacency matrix for a graph. Since I read it is not safe to use arrays of the form <code>matrix[x][y]</code> because they don't check for range, I decided to use the vector template class of the stl. All I need to store in the matrix are boolean values. So my question is, if using <code>std::vector&lt;std::vector&lt;bool&gt;* &gt;*</code> produces too much overhead or if there is a more simple way for a matrix and how I can properly initialize it.</p>
  
  <p>EDIT: Thanks a lot for the quick answers. I just realized, that of course I don't need any pointers. The size of the matrix will be initialized right in the beginning and won't change until the end of the program. It is for a school project, so it would be good if I write "nice" code, although technically performance isn't too important. Using the STL is fine. Using something like boost, is probably not appreciated. </p>