-
๋ณ์ ํ์ ๋ณํ์ฝ๋ฉํ ์คํธ/์ฝ๋ฉํ ์คํธ ํ 2020. 8. 28. 19:51728x90
string to char * : str_cstr();
string to char๋ฐฐ์ด
char cstr[100]; string str = "hello"; strlen(cstr, str.c_str());
char ๋ฐฐ์ด to string
char *cstr = "hello"; string str = cstr;
char to int, float, long : atoi, atof, atol (ํค๋ cstdlib)
string to int :
string str = "100"; int num; num = atoi(str.c_str());
int to string : to_string()
int num = 10; string str; str = to_string(num);
728x90'์ฝ๋ฉํ ์คํธ > ์ฝ๋ฉํ ์คํธ ํ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
์ฐ์ ์์ํ (0) 2020.09.06 ์์์ ์๋ฆฌ ์ถ๋ ฅ (0) 2020.08.28 C++ ๋ฌธ์์ด ์๋ฅด๊ธฐ (0) 2020.04.09 ์ฝํ ํ๋ฉด์ ํท๊น๋ฆฌ๋ ๊ฒ๋ค (0) 2020.04.05 MST (0) 2020.03.26