is this valid ?

Discussion in 'C++' started by Karl Heinz Buchegger, May 6, 2004.

  1. dumboo wrote:
    >
    > i m having
    > int *p = NULL;
    >
    > delete [] p;
    >
    > maybe it is since, i m deleting a null which is valid..
    >


    This is valid. delete with a 0 pointer is always valid.

    --
    Karl Heinz Buchegger
     
    Karl Heinz Buchegger, May 6, 2004
    #1
    1. Advertising

  2. Karl Heinz Buchegger

    dumboo Guest

    i m having
    int *p = NULL;

    delete [] p;

    maybe it is since, i m deleting a null which is valid..

    --
    _____________________________
    Experience is a good teacher..
    Are you a good student ?
     
    dumboo, May 6, 2004
    #2
    1. Advertising

  3. Karl Heinz Buchegger

    Allan Bruce Guest

    "Karl Heinz Buchegger" <> wrote in message
    news:...
    > dumboo wrote:
    > >
    > > i m having
    > > int *p = NULL;
    > >
    > > delete [] p;
    > >
    > > maybe it is since, i m deleting a null which is valid..
    > >

    >
    > This is valid. delete with a 0 pointer is always valid.
    >


    but deleting an array pointer may be a problem?
    Allan
     
    Allan Bruce, May 6, 2004
    #3
  4. Allan Bruce wrote:
    >
    > "Karl Heinz Buchegger" <> wrote in message
    > news:...
    > > dumboo wrote:
    > > >
    > > > i m having
    > > > int *p = NULL;
    > > >
    > > > delete [] p;
    > > >
    > > > maybe it is since, i m deleting a null which is valid..
    > > >

    > >
    > > This is valid. delete with a 0 pointer is always valid.
    > >

    >
    > but deleting an array pointer may be a problem?
    > Allan


    No.

    --
    Karl Heinz Buchegger
     
    Karl Heinz Buchegger, May 6, 2004
    #4
  5. Karl Heinz Buchegger

    JKop Guest

    dumboo posted:

    > i m having
    > int *p = NULL;
    >
    > delete [] p;
    >
    > maybe it is since, i m deleting a null which is valid..
    >
    > --
    > _____________________________
    > Experience is a good teacher..
    > Are you a good student ?
    >
    >


    Why?



    -JKop Why?
     
    JKop, May 6, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aschel Kritsos

    Valid file types

    Aschel Kritsos, Nov 11, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    604
  2. Ajit
    Replies:
    1
    Views:
    3,641
    Victor Garcia Aprea [MVP]
    Apr 24, 2004
  3. CT

    vbc is not valid command

    CT, Oct 30, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    2,862
  4. Pial
    Replies:
    6
    Views:
    52,460
    Nassos
    Apr 28, 2005
  5. MM
    Replies:
    3
    Views:
    452
    Kai Harrekilde-Petersen
    Jun 19, 2004
Loading...

Share This Page