CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006
    Posts
    9

    Argument of type void

    Hi folks...

    Can anyone make sense of this error message?!

    Code:
    argument of type ‘void (packet_analysis::)(u_char*, const pcap_pkthdr*, const u_char*)’
    does not match ‘void (*)(u_char*, const pcap_pkthdr*, const u_char*)’
    I originally had this function in main, but after a re-jig i put it in the constructor of the class 'packet_analysis'.

    How can i make it match!!

    Thanks,
    Dom

  2. #2
    Join Date
    Dec 2003
    Location
    Middletown, DE
    Posts
    67

    Re: Argument of type void

    It looks like you're passing a function pointer, whose types aren't a perfect match. Let's see the code you've written.

  3. #3
    Join Date
    Dec 2004
    Location
    Poland
    Posts
    1,165

    Re: Argument of type void

    More exactly, you are trying to pass a pointer to member function, where pointer to global function is expected. This does not work. For more info, read following: http://parashift.com/c++-faq-lite/po....html#faq-33.2

    Cheers
    B+!
    'There is no cat' - A. Einstein

    Use [code] [/code] tags!

    Did YOU share your photo with us at CG Members photo gallery ?

  4. #4
    Join Date
    Jan 2006
    Location
    Belo Horizonte, Brazil
    Posts
    405

    Re: Argument of type void

    This is also an interesting article:

    http://www.goingware.com/tips/member-pointers.html

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

Featured