Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 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 |
Tags
- etc2
- ChatGPT
- python_distutils_module_missing
- unreal_flavorselection
- asset database_androidlib
- xcode_targeting
- Unity2022
- sourcetree_accessdenied
- molocon24내용정리
- unreal_android_빌드옵션
- jenkins_role관리_플러그인
- unreal_contentmanagement
- molocon24후기
- unity package_androidlib
- jenkins_owasp
- python3.12.4
- jenkins_계정삭제
- xcode-select_jeknins
- jenkins_sudo
- cookcontent
- unrealbuildshellscript
- molocon24
- sourcetree_authencicationfailed
- apkipa업로드저장소
- unreal_binaryselection
- owasp_dependency_check
- appcenter대체
- owasp_depdendency_check_shell
- dxt
- unrealbuildcommand
Archives
- Today
- Total
mystic-agit 개발 블로그
C++ 변수 타입 형 변환 본문
Cocos2d-x 프로젝트 관리 중 주로 사용했던 형 변환 방법을 기록해두었다.
#include <stdio.h>
using namespace std;
void TestClass::myTest() {
// int to bool
bool value1 = bool(1);
// bool to int
int value2 = int(true);
// int to string
string value3 = to_string(123456);
// string to int
int value4= stoi("123456");
// int to double
double value5 = static_cast<double>(123);
// double to int
int value6 = (int)(value5);
// 단, 소수점이하 값이 있는 double일 경우 반올림 여부는 round 등 함수를 통해 별도로 해결 필요
}
'Cocos2d-x' 카테고리의 다른 글
C++ 클래스명 중복 사용 시 runtime 중 크래시 이슈 (0) | 2023.04.18 |
---|---|
error: undefined reference to 빌드 에러 발생 시 (0) | 2023.04.12 |
Comments