• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

declaring an array of pointers in c++

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
I strongly recommend learning how to use the Visual C++ debugger (kicks butt), or gdb (the linux attempt at making a debugger 😉). Visual C++'s debugger is really good and not too hard to use.
 
Originally posted by: TheDiggler
for (int i=0; i < num_trans; i++) delete tran[i]; // Even safer: wrap it with an "if (tran[i] != NULL)" sanity check

Actually although its not considered good style, deleting a NULL is safe in any compiler that follows ANSI standards. deleting NULL is actually defined to do nothing.

 
Originally posted by: CTho9305
I strongly recommend learning how to use the Visual C++ debugger (kicks butt), or gdb (the linux attempt at making a debugger 😉). Visual C++'s debugger is really good and not too hard to use.

Debugger??? You mean you weren't taught that you're simply supposed to write BUG FREE code the first time around?!?! 😛 And yes, you are absolutely correct. I had to rely on debug "cout" statments when helping IKeelU because it would have been next to impossible to teach a person how to use a Debugger via these forums. :Q
 
Back
Top