Don't understand this 'sizeof' expression.

This is a discussion on Don't understand this 'sizeof' expression. within the C Programming forums, part of the General Programming Boards category; The answer is : system dependent. So it can be answered (kidding a bit :P)...

  1. #16
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,675
    The answer is : system dependent. So it can be answered (kidding a bit :P)
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  2. #17
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,299
    Quote Originally Posted by pyroknife View Post
    Oh thank you.

    What if we defined:
    int buf[100]

    What would be the size of *buf now?
    It would be the size (in bytes) of an int, on the target system.
    This is often 4.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. initializer expression list treated as compound expression
    By karthikeyanvisu in forum C Programming
    Replies: 7
    Last Post: 02-26-2011, 04:19 PM
  2. Replies: 2
    Last Post: 11-25-2009, 06:38 AM
  3. Replies: 6
    Last Post: 10-15-2007, 08:05 AM
  4. sizeof(cin) and sizeof(cout)
    By noobcpp in forum C++ Programming
    Replies: 11
    Last Post: 06-30-2007, 11:00 AM
  5. sizeof and Expression Evaluation
    By Dave_Sinkula in forum C Programming
    Replies: 2
    Last Post: 08-11-2003, 07:11 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21