To print boolean

Hi guys!,

A basic question:
What's the syntax to print a boolean array??
if I have an array something like this,
 
  bool *boolArray = new bool[arraySize]


How to print it in terms of 0s and 1s??

Thanks!!
1
2
3
4
5
6
7
8
9
10
11
12
13
// Example program
#include <iostream>
#include <string>

bool myBoolArray[4] = { false,true,false,true };

int main()
{   
    for( int i=0; i < 4; i++)
    {
        std::cout << myBoolArray[i];
        }
}
Topic archived. No new replies allowed.