Thread: I want to pass in a pointer to a vector of type Triangle*

  1. #1
    Shadow12345
    Guest

    I want to pass in a pointer to a vector of type Triangle*

    My subject pretty much sums this up. I can't seem to be able to pass a memory address of a vector to a function.
    Code:
    vector<Triangle*> TriangleVector;//Vector I am working with
    .....................................................
    //Here I want to pass a pointer to a vector of Trianglepointers 
    void GetMirrorTri(vector<Triangle*> *TriVec);
    ......................................................
    //This is how the function will be called in the program
    GetMirrorTri(&TriangleVector[Index]);
    This code compiles when I try to declare the function to take a references instead of a pointer
    Last edited by Shadow12345; 10-13-2002 at 07:11 AM.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Moved from Game Board at the request of original poster

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can you check what is wrong with this code
    By Ron in forum C++ Programming
    Replies: 4
    Last Post: 08-01-2008, 10:59 PM
  2. Speed test result
    By audinue in forum C Programming
    Replies: 4
    Last Post: 07-07-2008, 05:18 AM
  3. Incompatible Pointer Type warnings
    By trillianjedi in forum C Programming
    Replies: 3
    Last Post: 06-11-2008, 04:16 PM
  4. Glib and file manipulation
    By unixOZ in forum Linux Programming
    Replies: 1
    Last Post: 03-22-2004, 09:39 PM
  5. Erros in Utility Header File
    By silk.odyssey in forum C++ Programming
    Replies: 4
    Last Post: 12-22-2003, 06:17 AM