1
malloc
32 bits or 4 bytes. This depends heavily on the processor architecture your computer uses, AND the programming language you are using. Typically, an integer is 1 word in length, however that processor architecture defines "word". That could be 32-bits (4 bytes), 64-bits (8 bytes), 8-bits (1 byte), or even 9 bits (in certain old computers).
It depends on the platform... In a 16 bit environment, such as DOS or Windows 3.x, a near pointer is two bytes, while a far pointer is 4 bytes. In a 32 bit environment, such as Win32, a pointer is 4 bytes. In a 64 bit environment, such as Win64, a pointer is 8 bytes. If you want to find out in your particular environment, look at sizeof(ptr), where ptr is declared as a pointer to something. char* ptr; std::cout << sizeof(ptr) << std::endl; Note that the size of the pointer is not the same as the size of the object to which it points. If you looked at sizeof(*ptr), you would get 1.
Not sure what you mean; if you want to measure the "input size" in bytes, that would probably be 8 bytes, since integers typically use 4 bytes.
For any type T, the type T[n] is an array of n Ts. If n is known at compile time, the array is fixed-length and the compiler will allocate n * sizeof(T) bytes to the array name. If n is not known at compile time, the array is variable-length and the programmer must manually request n * sizeof(T) bytes from the system at runtime, storing the start address in a pointer. The programmer must keep track of the stored address at all times and must release the memory as soon as it is no longer required.
1 bytes is 8 bits so (17/8) = 2.125 so round up to 3 full bytes
One byte is 0.125 to 1 bit. So 4 bits, is .5 bytes.
On a flash drive, one billion bytes is called a(n) _____________.
malloc
32 bits or 4 bytes. This depends heavily on the processor architecture your computer uses, AND the programming language you are using. Typically, an integer is 1 word in length, however that processor architecture defines "word". That could be 32-bits (4 bytes), 64-bits (8 bytes), 8-bits (1 byte), or even 9 bits (in certain old computers).
4, which is equal to 2 to the power 2.In general, with "n" bits, you can have "2 to the power n" different states (or represent that many different numbers).
the integer of 1/2 n
The number of address lines needed to access N-KB is given by log2N Then the number of address lines needed to access 256KB of main memory will be log2256000=18 address lines.
It depends on the platform... In a 16 bit environment, such as DOS or Windows 3.x, a near pointer is two bytes, while a far pointer is 4 bytes. In a 32 bit environment, such as Win32, a pointer is 4 bytes. In a 64 bit environment, such as Win64, a pointer is 8 bytes. If you want to find out in your particular environment, look at sizeof(ptr), where ptr is declared as a pointer to something. char* ptr; std::cout << sizeof(ptr) << std::endl; Note that the size of the pointer is not the same as the size of the object to which it points. If you looked at sizeof(*ptr), you would get 1.
Not sure what you mean; if you want to measure the "input size" in bytes, that would probably be 8 bytes, since integers typically use 4 bytes.
Depends on several factors:number of bytes per character: 1 to 4 depending on which alphabet and character encoding you use. 1 byte per character for US-ASCII and the most common Western Europe encodings.length of the string: bytes per character times number of charactersprogramming language: in C, the string takes up no more space than the characters do. In many other languages, there is an additional fixed overhead for the string object itself. For example in Java, a string takes 2-4 bytes plus the space taken by the characters.
You will need to specify n=