title: C++ issue separating array creation from function
body: <p>I'm starting to use c++ after a while to do some directx programming and I'm having a seemingly dumb issue. 
  I have a buffer that is currently using an array that is created inline:</p>
  
  <pre><code>Vertex vertices[]={{...},{...},...};
  </code></pre>
  
  <p>This array is used as a resource for the buffer creation. The issue I'm having is that I want to retrieve this array from a function because I want to create different structures that are not hard coded inside the method that creates the buffer. However, if I do something like Vertex* vertices=getDefaultVertices() where the definition for getDefaultVertices() is Vertex* getDefaultVertices() and return the structure I had above it will not work. Now I've found by looking around that part of the issue is that you can't create a local function array in c++ and return a reference to it. My question is what should I do to be able to retrieve this array? the only thing I can think of is to use a class with constants but I'd like to know a solution that uses a function to retrieve the array if possible.</p>