⭐ Programming/C++
[C++] 비교 연산과 논리 연산
[C++] 비교 연산과 논리 연산
2022.03.19비교 연산과 논리 연산 인프런 Rookiss님의 'Part1: C++ 프로그래밍 입문' 강의를 기반으로 정리한 필기입니다. 😎[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part1: C++ 프로그래밍 입문 강의 들으러 가기! 비교 연산 == != a > b a < b 논리 연산 ! && || 코드 더보기 #include // a[ 1 ] // a라는 이름의 바구니를 할당하고 안에 1을 넣는다. int a = 1; // b[ 2 ] // b라는 이름의 바구니를 할당하고 안에 2을 넣는다. int b = 2; bool isSame; bool isDifferent; bool isGreater; bool isSmaller; bool test; int hp = 100; bool isInvincibl..
[C++] 산술연산
[C++] 산술연산
2022.03.19산술연산 인프런 Rookiss님의 'Part1: C++ 프로그래밍 입문' 강의를 기반으로 정리한 필기입니다. 😎[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part1: C++ 프로그래밍 입문 강의 들으러 가기! 코드 더보기 #include using namespace std; // 오늘의 주제: 데이터 연산 // 데이터를 가공하는 방법에 대해서 알아봅시다 // a[ 1 ] // a라는 이름의 바구니를 할당하고 안에 1을 넣는다 int a = 1; // b[ 2 ] // b라는 이름의 바구니를 할당하고 안에 1을 넣는다 int b = 2; int main() { #pragma region 산술 연산 // 산술 연산자 // a에 b를 대입하고 b를 반환하라 // -> b라는 바구니 안에 있는 ..
[C++] 문자와 문자열
[C++] 문자와 문자열
2022.03.19문자와 문자열 인프런 Rookiss님의 'Part1: C++ 프로그래밍 입문' 강의를 기반으로 정리한 필기입니다. 😎[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part1: C++ 프로그래밍 입문 강의 들으러 가기! 문자 bool은 그냥 정수지만, 참/거짓을 나타내기 위해 사용한다 했었다. 사실 char도 마찬가지이다. 그냥 정수지만 '문자' 의미를 나타내기 위해 사용한다. char : 알파벳 / 숫자 문자를 나타낸다. wchar_t : 유니코드 문자를 나타낸다. ASCII (American Standard Code for Information Interchange) '문자'의 의미로 작은 따옴표 ' 사용 유니코드 (Unicode) 국제화 시대에는 영어만으로 서비스 할 수 없다. 전 세계 ..
[C++] Boolean & Floating point 불리언과 부동소수점
[C++] Boolean & Floating point 불리언과 부동소수점
2022.03.19Boolean & Floating point 불리언과 부동소수점 인프런 Rookiss님의 'Part1: C++ 프로그래밍 입문' 강의를 기반으로 정리한 필기입니다. 😎[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part1: C++ 프로그래밍 입문 강의 들으러 가기! Floating point 부동 소수점 bool은 그냥 1바이트 정수에 불과하다. 어셈블리 언어에서는 bool이라는 것이 없다. bool만 봐도 참/거짓 둘 중 하나라는 힌트를 준다. (가독성) 0은 false 0이 아닌 값은 true Floating point 부동 소수점 부동소수점: .을 유동적으로 움직여서 표현하는 방법 프로그래밍에서의 부동소수점은 항상 '근사값'이다. 1/3 = 0.3333333333333333333333..
Pseudo code : Bull Cow Cartridge
Pseudo code : Bull Cow Cartridge
2022.03.10BullCowCartridge.h 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 // Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Console/Cartridge.h" #include "BullCowCartridge.generated.h" UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent)) class BULLCOWGAME_API UBullCowCartridge : public UCartridge { GENER..
Pre-Increment/Decrement, Post-Increment/Decrement
Pre-Increment/Decrement, Post-Increment/Decrement
2022.03.101234567891011121314void UBullCowCartridge::OnInput(const Fstring& Input) // When the player hits enter{ int32 a = 1; int32 b = ++a; int32 c = ++ ++a; int32 d = a += 2; int32 e = a++; PrintLine(TEXT(%i, %i, %i, %i, %i), a, b, c, d, e); } Colored by Color Scriptercs Result 7, 2, 4, 6, 6
Visual Studio Code 단축키
Visual Studio Code 단축키
2022.03.10Ctrl + / = Toggle Line Comment // Shift + Alt + A = Toggle Block Comment /* */ Ctrl + K + C = Toggle Line Comment // Ctrl + K + U = Untoggle Line Comment Ctrl + D = Line Copy & Paste Ctrl + R R = Change name 이름 바꾸기 Ctrl + H = Replace (Ctrl + R R 이름 바꾸기 보다 더 자주 쓰인다) ------------------------------------------------------------- Ctrl + https://inpa.tistory.com/entry/VS-Co..
Ch 4.7 CircleRun
Ch 4.7 CircleRun
2022.03.0912345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#include using namespace std; class Circle {public: void init(int xval, int yval, int r); void draw(); void move();private: int x, y, radius;}; void Circle::init(int xval, int yval, int r){ x = xval; y = yval; radius = r;} void Circle::draw() // 화면에 원 생성{ HDC hdc = GetWindowDC(GetForegroundWindow()); //화면에 원..
Ch 3 Hangman
Ch 3 Hangman
2022.03.091 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 #include #include using namespace std; int main() { char ch; string solution; string list[] = { "the", "cat", "programming", "language", }; int n = rand() % 4; solution = list[n]; string guess(solution.length(), '_'); while (true) { cout
Ch 4.6 Class
Ch 4.6 Class
2022.03.08car.h 1 2 3 4 5 6 7 8 9 10 11 12 13 #include #include using namespace std; class Car { int speed; int gear; string color; public: int getSpeed(); void setSpeed(int s); }; cs car.cpp 1 2 3 4 5 6 7 8 9 10 #include "car.h" int Car::getSpeed() { return speed; } void Car::setSpeed(int s) { speed = s; } cs main.cpp 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #include "car.h" using namespace std; int main() { Car..