Thread: Transferring vector data to an array

  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    151

    Transferring vector data to an array

    I'm reading an obj file to get its vertex and index data, but the file I was reading didn't say how many vertices or indices, so I decided to use a vector to read it and then transfer the data to an array. The problem is that I can't do this.
    Code:
    UINT indices[vector.size()];
    How can I get around that?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Why do you need the array when you already have a vector?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 02-10-2012, 05:42 AM
  2. Replies: 1
    Last Post: 05-05-2009, 04:53 PM
  3. Transferring web C# projects to a different computer
    By Grayson_Peddie in forum C# Programming
    Replies: 1
    Last Post: 12-17-2003, 09:04 PM
  4. transferring GDI attributes.
    By Sebastiani in forum Windows Programming
    Replies: 4
    Last Post: 11-19-2002, 02:30 PM
  5. Transferring control to other execs
    By DarkDragon in forum C Programming
    Replies: 2
    Last Post: 12-28-2001, 03:01 PM