>>I meant what is wrong.
What is wrong is that the function was declared to return an integer, but it does not return anything. If you don't want that function to return an int then change it to a void function void CountElements()
, and if you do that then you can not use the function in the cout statement mentioned in the above post.