Thread: variable space

  1. #1
    Registered User
    Join Date
    Jul 2022
    Posts
    17

    variable space

    I don't understand how much space variable will occupy depend on what factor ?

    These are my doubts

    Does only compiler decide how much space variable will occupy ?

    Does only target machine decide how much space variable will occupy ?

    Does both compiler and target machine decide how much space variable will occupy ?

    I think compiler decide how much space variable for specific data type

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,435
    The compiler writer looks at what the machine is capable of, then decides on appropriate sizes for things like integers, chars etc.

    You as a user of that compiler are stuck with those choices.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-13-2020, 04:27 AM
  2. Replies: 13
    Last Post: 11-19-2019, 10:59 AM
  3. Replies: 2
    Last Post: 05-04-2017, 11:07 PM
  4. NUMA Virtual Adress Space / Physical Adress Space
    By NUMA Orly in forum Windows Programming
    Replies: 0
    Last Post: 03-14-2011, 03:19 AM
  5. Replies: 8
    Last Post: 02-14-2010, 04:14 PM

Tags for this Thread