Generate random binary arrays
Initialise your variables

You aren't initialising inc.  This is probably working for you, because the compiler is setting it to 0.  This isn't guaranteed though, so you should be explicitly initialising it before you use it:

long inc = 0;
srand(time(0));
while (inc &lt; 20)


Cleanup after yourself

As I mentioned in the comments, you're also leaking memory:

bool* b = new bool[size];


the allocated array is never cleaned up by your application.  You should have a paired delete somewhere in the code when you're done with the array:

delete [] b;


Expressive names

Think about using more expressive names.  You're referring to the array of bools as both 'b' and 'array' in different parts of your code.  One of the names tells your there's going to be more than one, whilst the other name hints at the type.

Your returnarray method actually prints it to the console.  If you get the names right, your program will be a lot easier to follow.