Thread: size of

  1. #1
    C is Sea. I know a drop! ganesh bala's Avatar
    Join Date
    Jan 2009
    Location
    Bangalore
    Posts
    58

    size of

    size of below arr is 20.. How it is??.. Can anyone explain it?...

    Code:
     char *a[]={"Oneon", "Twotw", "Three", "Fourinnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn", "Fivei" };

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    What do YOU think it should be, and can you think of an explanation as to why it is the way it is?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    C is Sea. I know a drop! ganesh bala's Avatar
    Join Date
    Jan 2009
    Location
    Bangalore
    Posts
    58
    addr=4 ... sizeof array is 5*4=20 .. right!! I m beginner.. thats why i was confused.. i try to avoid posting these type of questions!!

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by ganesh bala View Post
    addr=4 ... sizeof array is 5*4=20 .. right!! I m beginner.. thats why i was confused.. i try to avoid posting these type of questions!!
    That is not why I asked a question to answer your question. I want to train you to LEARN to think - if you get the answer on the a forum for every question you have, then you will never learn how to think for yourself. And not thinking for yourself works until you end up with a question that no one actually KNOWS the answer to.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  2. Pointer Size Relative To Integers?
    By SMurf in forum C Programming
    Replies: 1
    Last Post: 04-18-2006, 06:58 AM
  3. Invalid conversion from 'void*' to 'BYTE' help
    By bikr692002 in forum C++ Programming
    Replies: 9
    Last Post: 02-22-2006, 11:27 AM
  4. An exercise in optimization
    By Prelude in forum Contests Board
    Replies: 10
    Last Post: 04-29-2005, 03:06 PM