Thread: Vectors, Functions, "Type Specifier Omitted for Parameter" errors

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    37

    Vectors, Functions, "Type Specifier Omitted for Parameter" errors

    In my main program driver class, I have the following lines:

    Code:
    #include "Room.cpp"
    #include "Entity.cpp"
    #include <vector>
    
    using namespace std;
    
    int cleanUp();
    int gameLoop(Entity player, vector roomList);
    int loadMap(vector roomList);
    on my gameLoop prototype, I get a Type Specifier Omitted for Parameter error. I also get a parse error before ')'. On the next line...I get: 'vector' was not defined in this scope. The rest of the errors are the same, plus an error that I cannot pass objects of type `vector<Room,allocator<Room> >' through `...', which I presume means I can't pass vectors from function to function. What's wrong with this?

    --Ashiq

  2. #2
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    You must specify a type for the vector
    Code:
    int gameLoop(Entity player, vector<Room> roomList);
    or make the function a templated (is that a word?) function
    Code:
    template<typename T>
    int gameLoop(Entity player, vector<T> roomList);
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    37
    Ahhhh, brilliance! ...bit of a stupid thing to do, but at least it's easy to fix--thanks!!

    --Ashiq

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  2. weird errors gcc : functions like floor(), ceil(), sqrt()
    By gemini_shooter in forum C Programming
    Replies: 2
    Last Post: 06-04-2005, 09:00 AM
  3. weird errors gcc: functions like floor(), ceil(), sqrt()
    By gemini_shooter in forum Linux Programming
    Replies: 2
    Last Post: 06-04-2005, 08:39 AM
  4. Linker errors on Winsock2 functions
    By ShadowMetis in forum C++ Programming
    Replies: 2
    Last Post: 11-20-2004, 11:19 PM
  5. multiple declarations of functions errors
    By netwizio in forum C Programming
    Replies: 4
    Last Post: 03-07-2004, 09:02 AM