Thread: declaring arrays with visual C++ toolkit 2003

  1. #16
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    so I put:

    delete[] verts1;

    and it still alows me to use verts1 in other functions. I don't think that is working.

  2. #17
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    Yes, it should be delete [] verts instead of delete verts.

    If you call delete [], and then use the pointer elsewhere, it might work, or it might not. That is undefined behavior. It will usually cause your program to crash. The point is you must make sure that you don't use verts after you delete [] it.

  3. #18
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    so basicly just delete it in the clean up process. ok I'll do that.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  2. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  3. Using 'if' with char arrays or string objects
    By c++_n00b in forum C++ Programming
    Replies: 36
    Last Post: 06-06-2002, 09:04 PM
  4. odd errors from msvc std library files
    By blight2c in forum C++ Programming
    Replies: 6
    Last Post: 04-30-2002, 12:06 AM
  5. <list>
    By Unregistered in forum C++ Programming
    Replies: 9
    Last Post: 02-24-2002, 04:07 PM