Thread: pointers

  1. #1
    Registered User
    Join Date
    Sep 2012
    Posts
    22

    pointers

    I moved the external variables into main, but am stuck now on how to get my analyze_hand function to call correctly. Any input is appreciated.

    nevermind. thank you
    Last edited by brillpsycho; 11-16-2012 at 05:35 PM.

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Code:
    // function prototype
    void analyze_hand(int[],int[]);
    
    // function call
    analyze_hand(num_in_rank,num_in_suit,&straight, &flush, &four, &three, &pairs);
    
    // function definition
    void analyze_hand(int num_in_rank[], int num_in_suit[],*straight, *flush, *four, *three,*pairs)
    The prototype doesn't match the implementation. If there are other issues, please explain them clearly so we know where to look.

  3. #3
    Just kidding.... fnoyan's Avatar
    Join Date
    Jun 2003
    Location
    Still in the egg
    Posts
    275
    In C++ (not in C) you have an option to not set some arguments at the time function call provided that you declared default parameters.

    7.7 — Default parameters « Learn C++

    In your case, you have more parameters than you declared. So, your function decleration and call does not match. You must have compiler errors for the case

  4. #4
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Please don't delete your code from the original post. Otherwise, other people won't be able to learn from the problems you faced.

    I am here offering my time and abilities for no compensation, other than to help other people [such as yourself] improve their skills. By selfishly deleting your question, you've ensured that I was only able to help you with this question, not anyone else. That is rude, and makes people wary about offering you help in the future.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. size of struct with pointers and function pointers
    By sdsjohnny in forum C Programming
    Replies: 3
    Last Post: 07-02-2010, 05:19 AM
  2. Storing function pointers in generic pointers
    By Boxknife in forum C Programming
    Replies: 6
    Last Post: 08-01-2009, 01:33 PM
  3. Pointers to objects -- passing and returning pointers
    By 1veedo in forum C++ Programming
    Replies: 4
    Last Post: 04-04-2008, 11:42 AM
  4. weak pointers and use_count smart pointers
    By Mario F. in forum C++ Programming
    Replies: 2
    Last Post: 07-29-2006, 07:54 AM
  5. Pointers Question.....Null Pointers!!!!
    By incognito in forum C++ Programming
    Replies: 5
    Last Post: 12-28-2001, 11:13 PM