count_primes.cpp

This example shows how to count primes.

#include <primesieve.hpp>
#include <stdint.h>
#include <iostream>
int main()
{
uint64_t count = primesieve::count_primes(0, 1000);
std::cout << "Primes below 1000 = " << count << std::endl;
return 0;
}
primesieve::count_primes
uint64_t count_primes(uint64_t start, uint64_t stop)
Count the primes within the interval [start, stop].
primesieve.hpp
primesieve C++ API.