Those functions, unless declared in the bitarray.h
header, are local to the bitarray.cpp
. If you want access to them in sieve.h
, declare them in the bitarray.h
header, or in another file accessible by sieve.cpp
/sieve.h
.
// bitarray.h
class BitArray
{
public:
void Set(); // Example.
void Unset(); // Example.
};
// sieve.h
#include bitarray.h
void Sieve(BitArray a)
{
a.Set();
a.Unset();
}
EDIT:
I'm pretty certain that the issue you're having, is that you're not seeing changes to your BitArray
object because you're passing a copy of the original. Any changes you make to it in the Sieve()
function won't be reflected in the original object.
Try passing the BitArray
object by reference:
void Sieve(BitArray& a)
{
...