This is an extremely stupid question, but here goes...
I've got a class with this code:
class ArraySection {
public:
unsigned char *array;
int start, stop, k;
};
All I want to do is create an instance of this class in my main function. I'm trying to do it with this (where length & n are predefined):
ArraySection *ASarrayPrimes = nullptr;
ASarrayPrimes->array[length];
ASarrayPrimes->start = stop;
ASarrayPrimes->stop += length;
ASarrayPrimes->k = 0;
But I'm guessing this isn't the proper way to do it...? We never really covered this in class. (And if you're wondering, I'm supposed to use threads to parallelize the sieve algorithm to find prime numbers.) What I'm trying to do is take the massive array, break it down into smaller arrays (created with this ArraySection class given by the professor), then have threads work on finding primes in those separate, smaller threads.
edit: I can't change the class, guys. I can only work with what the professor gave.