c/c++ programming

This is a discussion on c/c++ programming within the C++ Programming forums, part of the General Programming Boards category; hello everybody, What is the memory allocated by the following definition ? int (*x)[10]; srinu with regards...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    17

    Cool c/c++ programming

    hello everybody,

    What is the memory allocated by the following definition ?
    int (*x)[10];

    srinu
    with regards
    srinu

  2. #2
    Registered User InFeStEd-ArCh0n's Avatar
    Join Date
    Apr 2002
    Posts
    63

    Re: c/c++ programming

    int (*x)[10];
    Well, you would assume that x would be a line of ten integers, but it's not. * declares it as a pointer. All pointers are DWORDs, meaning that they are 32 bit variables (on the x86 instruction set). Each 32 bit variable is 4 bytes and it holds a value up to 0xFFFFFFFF, or 4,294,967,295. 10 of then would be 40 bytes, and that is how much is allocated.
    -Mike
    {InFeStEd-ArCh0n}

Popular pages Recent additions subscribe to a feed

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