기억저장소

기억저장소

728x90
반응형

Programming Language 25

[C++] GetLastError()

[출처] http://www.winapi.co.kr/ApiBoard/content.php?table=tblqa&pk=13489FormatMessage()라는 함수인데, GetLastError()로 얻은 에러 코드가무슨 에러인지 알고 싶으면???char buffer[128];FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),NULL, buffer, 128, NULL);MessageBox(hWnd, buffer, "Error", MB_ICONHAND); 에러코드와 대응 상수 ----------------------------------------NO_ERROR equ 0ERROR_SUCCESS equ 0ERROR_INVALID_FUNCTION e..

[계절학기 C++] Class

7.1 Abstract Data Types (추상적데이터타입) 7.2 Object-Oriented Programming (객체지향프로그래밍) 7.3 Introduction to Classesclass Square { private: int side; public: void setSide(int s) { side = s; } int getSide() { return side; } }; 7.4 Introduction to ObjectsSquare sq1, sq2; 7.5 Defining Member Functions 7.6 Constructors (생성자) 7.7 Destructors (소멸자) 7.8 Private Member Functions 7.9 Passing Objects to Functions p..

[강좌2] 3일차

시험은 오픈북?, ~~~ - CPP 파일에서 컴파일, 링크, exe 파일 만드는 과정을 알자.- 키워드, Write a program to calculate how much a student center earns during its fund raising lemonade sale. The Program should prompt the user to enter the number of lemonades sold and the amount the student center earns for each lemonade sold. It should then calculate and display the total amount earned. - using namespace std?? - \t \a \\ \' \'..

vector...

벡터 어렵네.복사생성자를 잘 알면 파악할 수 있다.벡터를 동적으로 생성하게되면, 벡터를 계속 늘리게되면, x2배씩 늘어나게된다.--> insert가 2배씩 늘어나고 push_back이 1씩 늘어난다. 벡터와 복사 생성자 호출 순서가 포인트다.복사생성자 호출 시, 기존에 있던 배열값의 레퍼런스에 접근해서 초기값부터 복사를 해준다.그럴때마다 기존 값은 소멸되므로 계속 소멸자가 호출되는 불상사가 발생하게된다... 이정도만 알고있자.

728x90
반응형