This is not a homework site. Show us what you have so far, and ask good questions about what you don't understand.
If your code fails to compile, tell us that and give us the compiler error messages.
If your code compiles but does not do what it is supposed to do, tell us what it does vs. what it's supposed to do.
We don't generally respond to veiled (or even not so veiled) requests to do your homework for you.
I thought @Thomas1965's code snippet was a good starting point for you (although there is an error in it--you'll have to discover it before you can ask questions about it). My recommendation for you, however, is to not worry about count_primes until you get is_prime working first. Test is_prime on a series of numbers and make sure it works before worrying about dealing with an array.
Get out there and try stuff and see what it does. When it doesn't work, ask us a question.