Results 1 to 3 of 3

Thread: One function different parameters to pass

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    UK
    Posts
    222

    One function different parameters to pass

    How would i write my function so that depending on what i passed to it it would act on it:

    e.g.
    char *KeyType(WPARAM keyID)
    or
    char *KeyType(int keyID)

    without copying the whole function twice?

    cheers

    Andy

  2. #2
    amac
    Guest
    You could write the KeyType( int ) like this

    Code:
    char * KeyType( int nKeyID )
    {
    
        return( KeyType( (WPARAM) nKeyID ) );
    
    }

  3. #3
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    You could use Templates. If you search the form you will find more info on them.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width