unresolved external from void

error LNK2019: unresolved external symbol "void __cdecl readAndCount(int &,int * const)" (?readAndCount@@YAXAAHQAH@Z) referenced in function _main
1>C:\Users\Mike\Documents\HW\4\Debug\4.exe : fatal error LNK1120: 1 unresolved externals

i have no idea what to do...help?

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

 

#include <iostream>



 

using namespace std;

  int numWords;

 int letterCount[26]; // stores the frequency of each letter


void readAndCount (int &numWords, int letterCount[]);

// Reads a line of input. Counts the words and the number

// of occurrences of each letter.

 

void outputLetterCounts (int letterCount[]);

// Prints the number of occurrences of each letter that

// appears in the input line.

 

 


int main()

{

 int numWords;

 int letterCount[26]; // stores the frequency of each letter

 

 cout << endl;

 cout << "Enter a line of text.." << endl << endl;

 

 readAndCount (numWords, letterCount);

 

 cout << endl;

 cout << numWords << " words" << endl;

 outputLetterCounts(letterCount);

 

 return 0;

}

 


 

void outputLetterCounts(int letterCount[])

{

 for (int i = 0; i < 26; i++)

    {

      if (letterCount[i] > 0)

            {

             cout << letterCount[i] << " " << char('a' + i) << endl;

            }

    }

}


On line 17, you pass numwords as a reference (the '&' characted), in the prototype. But in 52 you simply pass numwords on it's own without the reference operator, that might be it.
Topic archived. No new replies allowed.