I have four characters as ch1,ch2,ch3,ch4. I am reading a binary file. Que- What following code indicates?
int GetLong(FILE * hTTF)
{
int ch1 = getc(hTTF);
int ch2 = getc(hTTF);
int ch3 = getc(hTTF);
int ch4 = getc(hTTF);
if ( ch4 == EOF )
return( EOF );
return( (ch1<<24)|(ch2<<16)|(ch3<<8)|ch4 );
}
consider ch1='k',ch2='e',ch3='r',ch4='n'; Tell me output and why this is so?. I am not understanding output value. Que-What is this conversion (ch1<<24)|(ch2<<16)|(ch3<<8)|ch4 What we achive by doing this?