function problem

This is a discussion on function problem within the C++ Programming forums, part of the General Programming Boards category; 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: ...

  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
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    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, 07: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-30-2005, 12:21 AM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 11:03 AM
  5. Problem with function pointers
    By vNvNation in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2004, 07:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21