반응형
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
- nonisolated
- @Binding
- NullObject
- Bug
- RxSwift
- swift6
- Operater
- subject
- RxCocoa
- typeorm
- nestjs
- graphql
- operator
- @Environment
- URL(string:)
- init?
- NavigationLink
- dismiss
- Creating Operators
- init
- ios14
- @EnvironmentObject
- @State
- RFC1738/1808
- SwiftUI
- Operators
- Xcode
- IOS
- vim
- SWIFT
Archives
- Today
- Total
Tunko Development Diary
std::string 형변환 정리. 본문
std::string to_str(int t) {std::stringstream ss;ss << t;std::string str = ss.str();return str;}std::string to_str(float t) {std::stringstream ss;ss << t;std::string str = ss.str();return str;}std::string to_str(long t) {std::stringstream ss;ss << t;std::string str = ss.str();return str;}std::string to_str(double t) {std::stringstream ss;ss << t;std::string str = ss.str();return str;}int from_str_to_int(std::string t) {const char* buffer = t.c_str();int i = atoi(buffer);return i;}long from_str_to_long(std::string t) {const char* buffer = t.c_str();long i = atol(buffer);return i;}double from_str_to_double(std::string t) {const char* buffer = t.c_str();double i = atof(buffer);return i;}float from_str_to_float(std::string t) {const char* buffer = t.c_str();float i = atof(buffer);return i;}
반응형
'Development > C++, C++11' 카테고리의 다른 글
숫자 자리수별 심볼 표시하기 K, M, G, T, P (0) | 2017.11.08 |
---|---|
std::vector erase 사용하기 (0) | 2017.10.18 |
std::string -> int [std::stoi 사용] (0) | 2017.10.11 |
std::string 문자열의 마지막 문자 가져오기 (0) | 2017.10.11 |
Comments