How to pass an array to a procedure

I need to pass parameters to a procedure.
What is the syntax for passing an array?

// Declare variables
int[] arrDealtCards = new int[2];
        int intHole1 = 5;
        int intHole2 = 7;
        int intFlop1 = 11;
        intFlop2 = 7;

        arrDealtCards[0] = intHole1;
        arrDealtCards[1] = intHole2;
        arrDealtCards[2] = intFlop1;

// Pass variables to the CheckForDup procedure
blnIsDup = CheckForDup(intFlop2, arrDealtCards, 3);  // line 81 generates the error

Error      2      The best overloaded method match for 'PreFlopPractice.CheckForDup(int, int, int)' has some invalid arguments      C:\Users\Admin\Documents\Visual Studio 2008\WebSites\NoLimitBusiness\PreFlopPractice.aspx.cs      81      20      C:\...\NoLimitBusiness\

 private bool CheckForDup(int pintDealtCard, arr[] parrDealtCards, int pintCtr)
    //Returns True if duplicate is found
   
    {
        bool blnIsDup = false;
        // This will loop until intFlop2 = one of the earlier cards
        int intCtr = 0;
        do
        {
            blnIsDup = (pintDealtCard == parrDealtCards[pintCtr]);
            intCtr++;
        }
        while (!blnIsDup);
         
        return blnIsDup;
    }

Thanks,

DovbermanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike TomlinsonMiddle School Assistant TeacherCommented:
Change:

    private bool CheckForDup(int pintDealtCard, arr[] parrDealtCards, int pintCtr)

To:

    private bool CheckForDup(int pintDealtCard, int[] parrDealtCards, int pintCtr)

*You are passing an array of "int", not an array of "arr".
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
käµfm³d 👽Commented:
Change this line:

private bool CheckForDup(int pintDealtCard, arr[] parrDealtCards, int pintCtr)

Open in new window


to this:

private bool CheckForDup(int pintDealtCard, int[] parrDealtCards, int pintCtr)

Open in new window

0
DovbermanAuthor Commented:
Thank you both for this workable solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.