c++ string을 통 특정 문자 제거
·
C++
#include #include using namespace std;string solution(string my_string, string letter) { my_string.erase(remove(my_string.begin(),my_string.end(), letter[0]),my_string.end()); return my_string;}remove(my_string.begin(), my_string.end(), letter[0]): 이 함수는 my_string의 시작부터 끝까지 탐색하면서 letter[0]과 일치하는 모든 문자를 "제거"합니다. 그런데 여기에서 "제거"는 실제로 해당 요소들을 문자열에서 삭제하는 것이 아니라, 문자열의 뒷부분으로 이동시키는 것을 의미합니다. remove..
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);}