|
내용을 보자면..
If the Perand has a class type, the operand is converted to a pointer type by calling the above-mentioned conversion function, and the converted operand is used in place of the original operand for the remainder of this section. In either alternative, if the value of the operand of delete is the null pointer the operation has no effect.
이라고 적혀있네요..
널이면 아무짓도 안한다...
흠냘.. ㅠ.ㅠ
수야!╋ 님이 쓰신 글 :
: char *s = NULL;
: delete s;
:
: 위 문장은 에러가 발생되지 않는군요 ( 빌더나 VC에서도요... )
:
: 많은 기간동안 NULL이 아닌놈을 지우기 위해서 발악해 왔습니다.
:
: 그런데 혼돈이 생겼네요.. -_-;
:
: #define SAFE_DELETE( x ) if( x ) delete x; x = NULL;
:
: 이렇게 선언하고 사용했는데
:
: 혼돈이 생겼습니다.
:
: if 문을 빼버려야하는 고민이 생겼거든요...
:
: delete가 하는 일을 알고 싶습니다.
:
: MSDN이나 빌더의 헬프를 찾아봐도 나오지 않는군요... 못찾은 걸지도..
:
: 프로그램을 하던 당시와 함께 당연하다 생각하던 널의 delete는 에러다 라는 ....
:
: 알려주세요~ ㅠ.ㅠ
|