3 Replies - 673 Views - Last Post: 02 August 2010 - 07:02 AM Rate Topic: -----

#1 skiabox   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-January 07

Build error

Posted 02 August 2010 - 05:06 AM

I get a build error when I try to build the following code.
//Finding the minimum value in an array

#include <stdio.h>


int minimum (int values[10]);


int mimimum (int values[10])
{
	int minValue, i;
	
	minValue = values[0];
	
	for (i = 1; i < 10; ++i)
		if (values[i] < minValue)
			minValue = values[i];
	
	return minValue;
}


int main (int argc, const char * argv[]) {
    // insert code here...
    int scores[10], i, minScore;
	
	
	
	printf("Enter 10 scores\n");
	
	for (i = 0; i < 10; ++i)
		scanf("%i", &scores[i]);
	
	minScore = minimum(scores);
	printf("\nMinimum score is %i\n", minScore);
	
	return 0;
}





Am I doing something wrong?

Is This A Good Question/Topic? 0
  • +

Replies To: Build error

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6260
  • View blog
  • Posts: 24,030
  • Joined: 23-August 08

Re: Build error

Posted 02 August 2010 - 05:14 AM

You might like to tell us what the errors are, so we don't have to do EVERYTHING.
Was This Post Helpful? 0
  • +
  • -

#3 Cuzzie   User is offline

  • D.I.C Regular
  • member icon

Reputation: 72
  • View blog
  • Posts: 342
  • Joined: 16-July 10

Re: Build error

Posted 02 August 2010 - 05:19 AM

From what I see, you made a typo. You spelt "minimum" as "mimimum". Besides, since your minimum() function comes before your main(), so I guess you won't be needing that function prototype int minimum(int values[10]);.

EDIT: Also, you should change the argument inint minimum(int values[10]) to int minimum(int values[])

This post has been edited by Cuzzie: 02 August 2010 - 05:23 AM

Was This Post Helpful? 2
  • +
  • -

#4 skiabox   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-January 07

Re: Build error

Posted 02 August 2010 - 07:02 AM

Thnx a lot for your help guys!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1