J
Jacek Dziedzic
Hi!
I accidentally did something like
float *ptr = new float[n*9];
where n was accidentally left uninitialized (and equal to something
like -1073372080) and my program coredumped.
I always thought that new was supposed to throw bad_alloc
when something goes bad with memory allocation... but
perhaps that isn't the case when a negative value is passed
within the [ ]?
BTW, what is the *type* of what is placed in between the [ ]
in new? int? unsigned int? size_t?
- J.
I accidentally did something like
float *ptr = new float[n*9];
where n was accidentally left uninitialized (and equal to something
like -1073372080) and my program coredumped.
I always thought that new was supposed to throw bad_alloc
when something goes bad with memory allocation... but
perhaps that isn't the case when a negative value is passed
within the [ ]?
BTW, what is the *type* of what is placed in between the [ ]
in new? int? unsigned int? size_t?
- J.