Sorry for the stupid question, but how can I know how to use mathematics, or C ++, how many bytes it will take to store an integer
You can get the first power of 2 which is larger than your number, and divides that power by 8, then you make the number round to the nearest integer For 1000, the power of 2 is 1024 or 2 ^ 10; Divide 10 to 8 to get 1.25, and make goals for 2. You need two bytes to keep 1000!
Comments
Post a Comment