Click here to Skip to main content
15,891,702 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can find 2nd sat of month? Pin
CPallini13-Sep-10 22:59
mveCPallini13-Sep-10 22:59 
GeneralRe: How can find 2nd sat of month? Pin
Eugen Podsypalnikov13-Sep-10 23:23
Eugen Podsypalnikov13-Sep-10 23:23 
AnswerRe: How can find 2nd sat of month? PinPopular
CPallini13-Sep-10 22:58
mveCPallini13-Sep-10 22:58 
QuestionPointer Pointing to Itself? Pin
Skippums13-Sep-10 14:45
Skippums13-Sep-10 14:45 
AnswerRe: Pointer Pointing to Itself? Pin
Peter_in_278013-Sep-10 19:13
professionalPeter_in_278013-Sep-10 19:13 
AnswerRe: Pointer Pointing to Itself? Pin
Aescleal13-Sep-10 23:30
Aescleal13-Sep-10 23:30 
GeneralRe: Pointer Pointing to Itself? Pin
Skippums14-Sep-10 3:46
Skippums14-Sep-10 3:46 
GeneralRe: Pointer Pointing to Itself? Pin
Aescleal14-Sep-10 3:57
Aescleal14-Sep-10 3:57 
The best way of avoiding delete stress like this is to not bother with fiddling about with multi-dimensional arrays. Use a vector or vector of vectors and you don't have to worry about declaring it properly, sizing it or freeing it. The class does all that for you with very little overhead (bit of space, maybe some run-time cost if your optimiser isn't up to much).

Or another way is to handle the multidimensional bit yourself over a one dimensional array but that's a bit fiddlier and not the sort of thing you want to think about unless you're writing a collection class.

Cheers,

Ash

PS: All those will delete primes - just be careful of what they're pointing to. Arrays of pointers are a good way of going gaga and there's usually a better way of doing them.

PPS: The designers of C designed pointers and arrays to be very close to the hardware - which is why they're a bugger to use properly. Fortunately in C++ you don't need to use them that much, there's almost always a better alternative.
QuestionSending HTTP Post via TCP/IP Pin
Dustin Henry13-Sep-10 11:15
Dustin Henry13-Sep-10 11:15 
AnswerRe: Sending HTTP Post via TCP/IP Pin
Dustin Henry13-Sep-10 11:37
Dustin Henry13-Sep-10 11:37 
GeneralRe: Sending HTTP Post via TCP/IP Pin
Moak14-Sep-10 0:32
Moak14-Sep-10 0:32 
AnswerRe: Sending HTTP Post via TCP/IP Pin
markkuk13-Sep-10 11:52
markkuk13-Sep-10 11:52 
GeneralRe: Sending HTTP Post via TCP/IP Pin
Dustin Henry13-Sep-10 12:15
Dustin Henry13-Sep-10 12:15 
AnswerRe: Sending HTTP Post via TCP/IP Pin
Moak14-Sep-10 0:22
Moak14-Sep-10 0:22 
GeneralRe: Sending HTTP Post via TCP/IP Pin
Dustin Henry14-Sep-10 7:02
Dustin Henry14-Sep-10 7:02 
QuestionValidating console input Pin
Danzy8313-Sep-10 7:33
Danzy8313-Sep-10 7:33 
AnswerRe: Validating console input Pin
mk1488213-Sep-10 9:08
mk1488213-Sep-10 9:08 
AnswerRe: Validating console input Pin
Aescleal13-Sep-10 11:10
Aescleal13-Sep-10 11:10 
Questiondelete option in IE8 address bar Pin
inza113-Sep-10 7:04
inza113-Sep-10 7:04 
Answersomeone?any idea? Pin
inza122-Sep-10 4:50
inza122-Sep-10 4:50 
QuestionCalling APIs Problem In Drivers Pin
Coder-12345613-Sep-10 7:00
Coder-12345613-Sep-10 7:00 
AnswerRe: Calling APIs Problem In Drivers Pin
JudyL_MD13-Sep-10 11:07
JudyL_MD13-Sep-10 11:07 
QuestionSet the RibbonComboBox to Drop List type by code Pin
coolhem13-Sep-10 4:23
coolhem13-Sep-10 4:23 
AnswerRe: Set the RibbonComboBox to Drop List type by code Pin
Eugen Podsypalnikov13-Sep-10 9:15
Eugen Podsypalnikov13-Sep-10 9:15 
GeneralRe: Set the RibbonComboBox to Drop List type by code Pin
coolhem13-Sep-10 14:56
coolhem13-Sep-10 14:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.