Results 1 to 6 of 6

Thread: quick little byte-sized questions

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    13

    Question

    how much memory does a variant use?
    and how much memory does a boolean use?

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Variant: 16 bytes for any datatype except strings, which need 22 bytes + stringlength * 2
    Boolean: 2 bytes
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    Isn't a boolean only 1 byte? I mean, what's the difference between an integer (2 bytes) and a boolean, if it's also 2 bytes.
    I know in VB3, the boolean data type did not exist, so I presume that this type only uses 1 byte.
    I'm not sure. Please correct me if necessary...

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    A boolean consumes 2 bytes, i know it sounds stupid but that's what it does, it's like enumerations, they are integers to allow negative numbers and -1 is true for a boolean variable, dunno if that's the connection..
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    So, for using one byte, do I need to declare String * 1 as data type?

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    byte datatype eats one byte and represents a numeric value from 0 to 255, if thats what you need. String*1 would consume 2 bytes and is represented as a string
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width