string stream
·
C++
#include // 필수 헤더// stream.str(string str)은 현재 stream의 값을 문자열 str로 변환int num;string str = "123 456";stringstream stream;stream.str(str);while(stream >> num) cout
Networking content
·
Unreal Engine 5/MMORPG 개발
Replicate액터에 Replicates 옵션을 키면 됨 Switch Has Authority 노드Authority : 대부분의 경우 서버에서 실행Remote : 대부분의 경우 클라이언트에서 실행서버, 클라이언트 어디서 실행중인지 검사하는데 사용된다. Variable ReplicationReplication을 Replicated로 설정하면 서버에서 이루어지는 변수 업데이트를 받음.Replication을 RepNotfiy로 설정하면 클라이언트와 서버 양쪽에서 같은 시퀀스가 실행된다. RepNotify 마킹된 변수는 값이 변할 때마다 Authority, Remote 양쪽에서 자동을으로 호출되는 특수 함수가 존재.값이 변하면 자동 생성되는 OnRep함수가 호출! 함수 ReplicationReplicate F..
언리얼 엔진 5 경로 관련 참고 사이트
·
Unreal Engine 5/MMORPG 개발
언리얼 경로 함수(Unreal Path Helper) (tistory.com)
간단한 Queue 학습 및 제작
·
C++
#include #include using namespace std;class _Q_Node{public: _Q_Node(int in_data=0) { next_node = nullptr; data = in_data; } class _Q_Node* next_node; int data;};class _Q_head {public: _Q_head() { front = nullptr; rear = nullptr; size = 0; } _Q_Node* front; _Q_Node* rear; int size;};void push(_Q_head* in_q, int in_data){ _Q_Node* newnode = new _Q_Node(in_data); if (in_q->size == 0) { in_q..
유클리드 호제법을 통한 최소공배수, 최대공약수 알고리즘
·
C++
/*** 최대 공약수* 무조건 a가 b보다 큰 수*/int gcd(int a, int b){ int r; while (b != 0) { r = a % b; a = b; b = r; } return a;}/*** 최소 공배수* 무조건 a가 b보다 큰 수*/int lcm(int a, int b){ return (a * b) / gcd(a, b);}
KMP 알고리즘
·
C++
문자열 매칭 알고리즘은 크게 3가지가 있다.KMP : 문자열 S가 있을 때, 패턴 P를 찾는 알고리즘Trie : 문자열 N개가 있을 때, 문자열 S를 찾는 알고리즘Aho-corasick : 문자열 N개가 있을 때, 패턴 P를 찾는 알고리즘그 중 KMP에 대해 알아보자 KMP 알고리즘은 KMP 알고리즘을 만든 Knuth, Morris, Prett의 앞글자를 따서 이름을 붙였다.KMP 알고리즘에서 알아야 하는 것은1. 접두사와 접미사apple을 예시로aapappapplapple elepleppleapple이다. 2. pi 배열pi[i]는 주어진 문자열의 0~i까지의 부분문자열 중 접두사==접미사가 될 수 있는 부분 문자열 중 가장 긴 것의 길이다이때, 접두사가 0~i까지의 부분 문자열과 같으면 안된다. 문자..