Allocation with new

Started by
11 comments, last by Leadorn 21 years, 9 months ago
quote:Original post by Null and Void
Yeah, I mentioned ''6.0, at least'' in my first reply.


Yes, but few posts down you said "MSVC''s new operator does not throw an exception." This might have lead the original poster to believe that the newest MSVC++ (then again, he didn''t say which version he''s using, and should''ve been questioned in the first reply) doesn''t throw a bad_alloc exception. My intent was to clear up possible misunderstanding.
Advertisement
quote:Original post by fallenang3l
My intent was to clear up possible misunderstanding.

That''s never a bad thing .

Hi again ive read you reply now.....

Dont be to mad at me....It was late here in sweden when i posted....

Ive done some testing..


    #include <iostream.h>#include <stdio.h>int  main(void){struct data{	char Data1[64000000];	char Data2[64000000];	char Data3[64000000];	char Data4[64000000];};data *ny1 = new data;data *ny2 = new data;data *ny3 = new data;data *ny4 = new data;cout << ny1 << endl;cout << ny2 << endl;cout << ny3 << endl;cout << ny4 << endl;int i;cin >> i;	return 0;}//No delete dosent matter in win2000...this is just for testing.    


Output..
0x00440040
0x0F870040
0x1ECA0040
0x00000000 Yea this is when it can allocate more.....





[edited by - leadorn on June 30, 2002 10:05:25 AM]

This topic is closed to new replies.

Advertisement