목록function (3)
일상 코딩
C++ 온라인 컴파일러 사이트 https://replit.com/~ https://www.onlinegdb.com/online_c++_compiler https://cpp.sh/ https://www.tutorialspoint.com/compile_cpp_online.php #include using namespace std; template T getMax(T x, T y) { return (x > y) ? x : y; } int main() { { cout
#include #include #include #include #include void goodbye(const std::string& s) { std::cout
static은 this-> 포인터 사용 불가. class 내부 함수는 특정 instance에 묶여있지 않다. #include using namespace std; class Something { public: // inner class class _init { public: //inner class 생성자 _init() { s_value = 9876; } }; private: static int s_value; int m_value; static _init s_initializer; public: // 특정 instance 없이도 // s_value에 접근 가능하도록 // 함수 앞에 static을 붙여준다. static int getValue() { //static은 this-> 를 사용하지 못함. re..