카테고리
자주찾기
이글루 파인더
태그
뿌뿌뿡
character-set
web
mysql5
xampp
linux
wifi
safari
Sis760
phpmyadmin
eclipse
utf8
큐브
모질라커뮤니티연말모임
JFace
여러분이거다거짓말인거아시죠
드라이버
flv
apache
인코딩
Ubuntu7.10
JDBC
최근 등록된 덧글
최근 등록된 트랙백
Free nokia ringtones.
by Ringtones.
Instant payday loan.
by Payday loan.
Instant payday loan.
by Payday loan.
by Ringtones.
Instant payday loan.
by Payday loan.
Instant payday loan.
by Payday loan.
p= new (nothrow) int[i];
The user could have entered a value for i so big that our system could not handle it. For example, when I tried to give a value of 1 billion to the "How many numbers" question, my system could not allocate that much memory for the program and I got the text message we prepared for this case (Error: memory could not be allocated). Remember that in the case that we tried to allocate the memory without specifying the nothrow parameter in the new expression, an exception would be thrown, which if it's not handled terminates the program.
It is a good practice to always check if a dynamic memory block was successfully allocated. Therefore, if you use the nothrow method, you should always check the value of the pointer returned. Otherwise, use the exception method, even if you do not handle the exception. This way, the program will terminate at that point without causing the unexpected results of continuing executing a code that assumes a block of memory to have been allocated when in fact it has not.
오랜만에 C++를 하니까 별 것이 다 신기해보인다.
The user could have entered a value for i so big that our system could not handle it. For example, when I tried to give a value of 1 billion to the "How many numbers" question, my system could not allocate that much memory for the program and I got the text message we prepared for this case (Error: memory could not be allocated). Remember that in the case that we tried to allocate the memory without specifying the nothrow parameter in the new expression, an exception would be thrown, which if it's not handled terminates the program.
It is a good practice to always check if a dynamic memory block was successfully allocated. Therefore, if you use the nothrow method, you should always check the value of the pointer returned. Otherwise, use the exception method, even if you do not handle the exception. This way, the program will terminate at that point without causing the unexpected results of continuing executing a code that assumes a block of memory to have been allocated when in fact it has not.
오랜만에 C++를 하니까 별 것이 다 신기해보인다.



