Unknown error plaese help

Error 1 error LNK2019: unresolved external symbol "void __cdecl prntSrt(int *,int)" (?prntSrt@@YAXPAHH@Z) referenced in function _main Error 2 error LNK1120: 1 unresolved external

Can someone tell me how to fix this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include <iostream>


using namespace std;


//Function PRtotypes
void mean(int *,int);
void median(int *, int);
float *mode(int *, int);
void sortAry(int *, int);
void minPos(int *,int ,int);
void swap(int *, int*);
void prntSrt(int *, int);

//Execution begins here
int main()
{
	//Declare variables
 const int arraySize = 2;
 const int patternSize = 10;

	//Create the allocated array
    int *array=new int[arraySize];

	//Creates the array
    for(int i=0;i<arraySize;i++){
        array[i]=i%patternSize;
    }
 
	//outputs the array
	for(int i=0; i<arraySize; i++)
	{
		cout << (*array+i) << " ";
	}
 
prntSrt(array, arraySize);


  cout << "The mean of the array is: " << endl;
 // CAlls for the mean function
 mean(array, arraySize);

 delete[] array;

	system("PAUSE");
	return 0;
}
//Determine the mean
void mean(int *array, int arraySize)
{
	float sum=0;
	float mea=0;

	for(int i=0; i<arraySize; i++){
		
		sum += *(array+i);
		mea = sum/arraySize;
		
	}
	cout << mea;
	
}

void sortAry(int *array,int n){
   
    for(int i=0;i<n-1;i++){
        minPos(array,n,i);
    }
}

void minPos(int *array,int n,int pos){
	

    for(int i=pos+1;i<n;i++){
        if(*(array+pos)>*(array+i))
            swap(array+pos,array+i);
	}
    }

	void swap(int *a,int *b)
	{
    //Swap in place
    *a=*a^*b;
    *b=*a^*b;
    *a=*a^*b;
	}

void prntSort(int *array, int arraySize)
	{
		for(int i=0; i<arraySize; i++)
		{
			cout << *(array+i);
		
		}


	}
Probably because you prototype a function as prntsrt then you never define that prototype that you are calling on line 37. THen you declare and define a function called prntsort on line 89. Maybe you meant prntsrt on line 89?
Topic archived. No new replies allowed.