Thread: function problem

  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    33

    function problem

    Code:
    void Shoot_Left		(void Draw( CHAR_INFO scene[50][80] ), CHAR_INFO scene[50][80], Linked_List<Entity> &LL_ENTITY );
    and the function placed in paramater 1:
    Code:
    void Draw_Maze(CHAR_INFO scene[50][80]);
    I this: error C2664: 'Shoot_Left' : cannot convert parameter 1 from 'void' to 'void (__cdecl *)(struct _CHAR_INFO [][80])'
    Expressions of type void cannot be converted to other types
    Error executing cl.exe.

    Game_Def.obj - 1 error(s), 0 warning(s)

    What the hell? The function matches the other exactly.
    “Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. " -John Carmack

  2. #2
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949
    I'm a little confused at what you are trying to do - is that supposed to be a line of code, a prototype, what? Why are you converting parameter one to a void function pointer?
    Do not make direct eye contact with me.

  3. #3
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Are you trying to pass a function as a parameter?

    You need to use a function pointer, and pass the function's address.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 10-29-2008, 06:33 AM
  2. wxWidgets link problem
    By cboard_member in forum C++ Programming
    Replies: 2
    Last Post: 02-11-2006, 02:36 PM
  3. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  5. Problem with function pointers
    By vNvNation in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2004, 06:49 AM