I want to ask few questions about bits and bytes as I am very confused.
For example, suppose I have a
short int x = 345;. I know that short take 16 bits, so when I write the short in a file it is written as char '3' , '4' ,'5' each containing 1 bytes so total of 24 bits. Is there a way to write the number (short integer) in file as short integer taking 16 bits?Also am I right in my concept? What will be the difference in writing to my file if the file is binary or text in terms of bytes?