ES6 이터러블 /이터레이터, 리스트 순회
리스트 순회 기존 for(var i =0;i< str.length;i++){ ... } es6 for(const a of list){ ... } 간결하게 변경 되었음 이터러블/이터레이터 Array , Set, Map const arr = [1,2,3]; for(const a of arr){ } const set = new Set([1,2,3]); for(const a of set){ } const map = new Map(['a',1], ['b',2] , ['c',3]); for(const a of map){ } array 는 arr[0] , arr[1] 이렇게 해서 값을 찾을 수 있지만 Set과 Map은 불가능함 어떻게 for of문에서 동작이 되는가? Symbol.iterator es6에 추가된 sy..
2021. 7. 3.
vsCode 에서 C++ 실행 및 디버깅
task.json 이거 생성하는 방법은 구글링...하면 다 나와있음....{ "version": "2.0.0", "tasks": [ { "type": "shell", "label": "g++ build active file", "command": "/usr/bin/g++", "args": [ "-std=c++17", "-stdlib=libc++", "-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}.out", "&&", "${fileDirname}/${fileBasenameNoExtension}.out", //루트 밑에 sample_input.txt 생성해야한다. "", "${fileDirname}/sample_output.txt" ], ..
2021. 4. 19.