Home

i dont quite understand how to display the index. how should i work w/
if/else statement?

On Sep 9, 2:57 pm, "Default User" <defaultuse...@yahoo.com> wrote:
> Sneaky...@gmail.com wrote:
> > I need to write a function where the third parameter points to an
> > address whose dereferenced value equals one of the array element's
> > value, then the the function returns the index of the first matching
> > array element. Otherwise -1 is returned.
> > Here's what I have but I am going obviously wrong somewhere:
>
> > #include <iostream>
> > using namespace std;
>
> > // This function compares values
> > void indexvalue (int array [], int size, int *num)
> > {
> > for (int count = 0; count < size; count++)
> > {
> > if (*num = array [count])
>
> You say you are comparing, but you are actually assigning a value here.
>
> Brian

previous
next

Python and RTF
Re: How to Modify Console output AFTER it has gone to cout
Re: Why :: ? Why not : ? Why not . ? <- less clutter ?!?
Re: local function definitios are illegal
Re: Boolean parser..
łózka sypialnie
unibet.pl
unibet
Kettler
poker