|
-
April 19th, 2012, 04:14 AM
#3
Re: vector
 Originally Posted by Rajesh1978
The below code is giving me segment fault during delete [] (*iter) sometimes
1) Please state the compiler and if necessary, operating system you're using (compiler name and version -- for example, don't just say g++, say g++, the version of g++ being used, and Linux as the OS).
2) You are missing the <cstring> header, as laserlight pointed out.
3) Other than that, the code should work correctly, unless again, std::bad_alloc() was thrown because of the call to new[].
Regards,
Paul McKenzie
Last edited by Paul McKenzie; April 19th, 2012 at 04:16 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|