Questa

c=c|pow(2,h);

scrivila così

c=c | (int)pow(2.0, h);




P.S. La variabile mask non esiste ...