목록분류 전체보기 (257)
일상 코딩
1. 익명객체 #include using namespace std; class A { public: int m_value; A(const int &input) : m_value(input) { cout
# 타이핑 게임 제작 및 기본완성 import random import time # py sound for linux, pip install pyglet 설치 import pyglet import sqlite3 import datetime import keyboard words = [] # 영어 단어 리스트(1000개 로드) game_cnt = 1 # 게임 시도 횟수 corr_cnt = 0 # 정답 개수 check = dict() # 중복 단어 확인 dictionary # DB 생성 conn = sqlite3.connect("wordgameDB.db",isolation_level=None) cur = conn.cursor() # DB 테이블 생성 # id 자동 증가 # 정답수 # 걸린 시간 # 저장한 시..
1. 설치 sudo apt-get install zip unzip 2.zip 방법 $ zip [압축파일 이름].zip [압축할 파일 or 디렉토리] [압축할 파일 or 디렉토리] ... $ zip -r [압축파일 이름].zip [압축할 파일 or 디렉토리] ... # 디렉토리 압축 $ zip -j [압축파일 이름].zip [압축할 파일 or 디렉토리] ... # 디렉토리 이름 제외하고 압축 $ zip -u [압축파일 이름].zip [압축할 파일 or 디렉토리] ... # 변경되었거나 새로운 파일만 압축 3.unzip 방법 $ unzip [압축파일 이름].zip $ unzip [압축파일 이름].zip -d [압축 푸는 위치] # 압축이 풀리는 위치를 특정할 수 있다. $ unzip -d target_dir..
1. forward declaration 전방선언 #include using namespace std; class B; // forward declaration (전방 선언) class A { private: int m_value = 1; friend void doSomething(A &a, B &b); }; class B { private: int m_value = 2; friend void doSomething(A &a, B &b); }; void doSomething(A &a, B &b) { cout
https://gist.github.com/ihoneymon/652be052a0727ad59601 마크다운(Markdown) 사용법 마크다운(Markdown) 사용법. GitHub Gist: instantly share code, notes, and snippets. gist.github.com
1.파이썬 데이터베이스(SQLite)¶ 1-1.테이블 생성¶ In [ ]: import sqlite3 import datetime In [ ]: print('sqlite3 version : ', sqlite3.version) sqlite3 version : 2.6.0 In [ ]: # 데이터 추가 날짜 값 추출하기 now = datetime.datetime.now() print('now : ', now) nowDatetime = now.strftime('%Y-%m-%d %H:%M:%S') print('nowDatetime : ', nowDatetime) now : 2021-10-25 14:26:04.244614 nowDatetime : 2021-1..
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..
https://dohoons.com/blog/1617/ VSCode 유용한 단축키 설정 – dohoons(도훈) _(≥∇≤)ノミ☆ VSCode의 코드 편집 기능 중에는 기본 단축키 구성이 안 되어 있는 유용한 명령들이 많이 있습니다. 필요할 때 F1 키를 누르고 명령어 이름을 입력해서 사용할 수 있지만 제가 주로 사용하는 몇 가 dohoons.com

static 변수는 cpp 파일에서만 선언한다. #include using namespace std; class Something { public: static int s_value; }; int Something::s_value = 1; // define in cpp file(static 값일 경우.) int main() { cout