I'm trying to create a program which will print out all the prime numbers between two numbers using the Sieve or Eratosthenes. I'm trying to follow the pseudocode on the website, but i'm slightly stuck on the first bit which says:
Let A be an array of Boolean values, indexed by integers 2 to n,
initially all set to true.
I've tried doing this and I came up with this: (I was going to use #DEFINE but the range at which the prime numbers will be printed at will be based on user input so different each time)
bool *prime = malloc((number1-1) * sizeof(*prime));
However I think this only sets the size and not the actual values in the array.
I did some research on this already and found similiar questions on here, but they were all for different programming languages.