0

i need help with this program im getting this

1>selections.obj : error LNK2019: unresolved external symbol "void __cdecl displayArray(int * const)" (?displayArray@@YAXQAH@Z) referenced in function _main
1>D:\Documents and Settings\ERIC\Desktop\Projects\selections\Debug\selections.exe : fatal error LNK1120: 1 unresolved externals

please help

#include <stdio.h>
#include "genlib.h"
#include "simpio.h"

#define size 4

void sortArray (int numbers[]);
int indexMin (int numbers[], int low, int high);
void swap (int numbers[], int loc1, int loc2);
void getArray (int numbers[]);
void displayArray (int numbers[]);

int main()
{ 
	int numbers[size];

	getArray(numbers);

	sortArray(numbers );
	displayArray (numbers);
	system("pause");
}

void getArray(int numbers[])
{
	int i;
	for (i=0; i<size; i++)
	{
	printf("\nEnter next integer? ");
	numbers[i]=GetInteger();
	}
}

void display (int numbers[])
{
	int i;
	printf("\n The sorted list is: \n");
	for (i=0; i<size; i++)
	{
		printf("	%d	", numbers[i]);
	}
}

void sortArray (int numbers[])
{
	int i, minInd;
	for (i=0; i<size; i++)
	{
		minInd = indexMin (numbers, i, size-1);
		swap (numbers, i, minInd);
	}
}

int indexMin (int numbers[], int low, int high)
{
	int i, minInd;
	minInd=low;
	for(i=low;i<=high;i++)
	{
		if (numbers[i] < numbers[minInd]) minInd =i;
	}
	return (minInd);
}

void swap (int numbers[], int loc1, int loc2)
{
	int temp;
	temp=numbers[loc1];
	numbers[loc1]=numbers[loc2];
	numbers[loc2] = temp;
}
4
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by Aia
0

in the main function, you have to replace the displayArray (numbers) with the display (numbers) function.

Have fun.

0

in the main function, you have to replace the displayArray (numbers) with the display (numbers) function.

Have fun.

Or vice versa, that's why Salem said: "Be consistent!"

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.