I know that an ASCII character needs 1 byte of memory for storage, but if a computer uses a 64-bit word addressable memory does it mean that the character actually takes 8 bytes even when only 1 byte was needed?

Does being a 64-Bit word addressable memory mean the same as being a 64-Bit machine?

  • 1
    $\begingroup$ Welcome to CS.SE! The usual rule is to ask only one question per post. If you have two questions, you can ask them by making two separate posts. $\endgroup$ – D.W. Aug 11 at 19:21
  • $\begingroup$ I will keep that in mind. Thanks! $\endgroup$ – Yuvraj Singh Jadon Aug 14 at 16:23

It depends. A program can store 1 ASCII character in each 64-bit word, or 8 ASCII characters in each 64-bit word. It's up to each individual program to decide how it wants to store and format its data in memory. The latter would probably be more typical.

| cite | improve this answer | |
  • $\begingroup$ Or you could be like old-school Haskell and say that a string is a cons list of pointers to character objects, because who needs memory? $\endgroup$ – Aaron Rotenberg Aug 12 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.