Creative Commons License

태그 : cpp 요약보기전체보기목록닫기

1

기본 생성자가 없는 객체 배열을 만들 수 있나?

C++ in Action Book: Pointers There is no direct way to initialize the contents of a dynamically allocated array. We just have to iterate through the newly allocated array and set the values by hand...

Double free

각종 표준에는 이미 해체한 메모리를 다시 해체하려고 할 때 행동을 정의하지 않고 있으나, GLIBC는 깔끔하게 자살해주고 있다. 자살할 때 패턴을 눈에 익혀 놓으면 나중에 왜 죽었지?하는 일이 줄어들 것이다. #include <stdlib.h> int main(int argc, char* argv[]) {   ...

delete this

[16] Freestore management, C++ FAQ Lite (내 맘대로 번역) [16.15] Is it legal (and moral) for a member function to say delete this? [16.15] 멤버함수에서 'delete this'가 올바른 구문인가? As long as you're careful, i...

list::insert, list::erase

STL가 제공하는 list에 insert, erase는 각각 iterator를 반환한다. (형태에 따라 반환하지 않는 것도 있으니 주의) iterator insert(iterator pos, const T& x) : pos 앞쪽에 x를 넣고, x에 대한 iterator를 반환한다.iterator erase(iterator pos) : pos에 ...

virtual destructor in C++

소스 #include <iostream> using namespace std; #define SHOWFUN() do { cerr << __PRETTY_FUNCTION__ << endl; } while(false) class CParent1 { public:     explic...
1

Google Adsense

Google Adsense

마리오카트 면허증

Google Analytics