It means that it can not find a definition for int cnt(int);
, which main()
uses and you forward declare.
Instead, you define:
int cnt(int x[30]) { ... }
These are two different signatures. One takes an integer argument, and the other takes an array of integers.
Additionally, this statement is incorrect:
q=cnt(x[30]);
This takes the 31st element at index 30 from the x
array. However, x
is only declared to be of size 30. Since you are using x
as an array inside your function, you probably just want to change your forward declaration to:
int cnt(int[30]);
And then invoke it like this:
q = cnt(x);