728x90 반응형 봉인71 참조 (Ampersand) #include #include /* param에 5를 복사하고 이 param을 func_Amp에 매개변수로 전달(복사 아님)한다. int& a = param이 되고 param에 a 별명을 붙여준다. func_Amp는 별명을 반환하는 함수다. */ int& func_Amp(int& a) //주소 받을 때는 int* a { return a; } int main() { //param을 바꿨을 때 temp도 값이 바뀜 int param = 5; int &temp = func_Amp(param); //별명을 반환 std::cout 2022. 7. 27. 함수 재정의와 함수 오버라이딩(virtual) 1.함수 재정의 #include using namespace std; class Base { public: ① virtual void f() {cout f()를 호출했다고 판단하여 Base::f()가 실행된다. 2. 함수 오버라이딩 #include using namespace std; class Base { public: ① void f() {cout f()는 Base의 f()에 대한 호출로 인지되지만 이를 Derived의 f()로 연결시킴 최종적으로 동적 바인딩을 통해 Derived의 f()가 호출 2022. 7. 27. pixel color fast https://stackoverflow.com/questions/10515646/get-pixel-color-fastest-way Get Pixel color fastest way? I'm trying to make an auto-cliker for an windows app. It works well, but it's incredibly slow! I'm currently using the method "getPix... stackoverflow.com I'm trying to make an auto-cliker for an windows app. It works well, but it's incredibly slow! I'm currently using the method "getPixel" whic.. 2022. 7. 27. section .bss #include int main() { int* bss;//지역 변수는 스택 영역 printf("%p\n", bss); //포인터에 저장된 값 (=주소) printf("%p\n", &bss); //포인터의 주소 값 *bss = 3; printf("inner bss is : "); printf("%d\n", *bss); //포인터가 가리키는 주소에 저장된 값 //bss가 가리키는 공간이 없는데 거기에 3을 넣으라고 하니 아래로 프로그램 종료 return 0; } 출력: C:\C>bss.exe 00000001 00AFFE14 inner bss is : C:\C> -------------------- #include int main() { int mem; //스택 영역 int* bss = &mem; //스택 .. 2022. 7. 27. 이전 1 ··· 14 15 16 17 18 다음 728x90 반응형