Thread: c/c++ programming

  1. #1
    Registered User
    Join Date
    May 2002

    Cool c/c++ programming

    hello everybody,

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

    with regards

  2. #2

    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.

Popular pages Recent additions subscribe to a feed