nextbit needs to be 0 because each time we call the function recursively , we call 2 times for 2 cases : next bit is 0 or 1 The is to assure that the binary string is printed one time only
if ( occur == 2 && nextbit == 0 ) printBinStr ( str , len ) ; return ; }