I have this audio file which I transformed it's audio values to binary numbers so that I hide them in image pixels.
what I used to convert the audio values was bitset<16> since the audio values are stored in short int variables.
the conversion to binary works well even if its a negative number but the conversion from the negative binary value to decimal is not working so does any one know a suitable way to convert negative binary numbers to decimal.
bitset <16>a = -8;
cout<<a<<endl;
output = 1111 1111 1111 1000
bitset <16>b = 8;
cout<<b<<endl;
output = 0000 0000 0000 1000
// but if i tried to convert the binary that i got earlier from the -8
bitset <16> c = 1111111111111000;
cout<< c.to_ulong()<<endl;
output = 29016
// how can i get the output of -8 from the c?