array of zero elements

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • George3

    array of zero elements


    Hello everyone,


    Sometimes, we allocate array of zero elements. I am wondering for what
    regualr purpose will we do that?

    I have tested that in Visual Studio 2008, it runs ok.


    Code:
    --------------------

    int main()
    {

    char* buf = new char [0];

    delete[] buf;

    return 0;
    }

    --------------------



    thanks in advance,
    George



    --
    George3
    ------------------------------------------------------------------------
    Posted via http://www.codecomments.com
    ------------------------------------------------------------------------

Working...