범위 for을 사용해서 string내의 모든 문자를 x로 바꾸는 코드를 만드는게 문제고
한 문자씩 읽어들여서, 그게 문자인지 판독하는 것 까지는 짰는데 그 문자를 x로 바꾸는 방법을 모르겠음
구글링에선 string의 replace같은걸 알려주는데, replace는 그냥 string전체에서 지정한 위치의 문자열을 치환하는 것 같아서 string내의 char문자를 바꿔야하는 나랑은 다른 것 같은데 어떻게 해결하면 좋을까?
뉴비련 질문 삭제같은 양심 애미뒤진 짓 안함
- dc official App
c = 'x'
아 " "랑 ' '가 다르구나... 고마워! 혹시 " "는 const char로 처리되는거야? - dc App
" "는 const char*, " "s는 std::string, " "sv는 std::string_view
A narrow string literal has type “array of n const char”, where n is the size of the string as defined below, and has static storage duration (3.7).
아하 공부가 되었습니다 선생님.. - dc App
뉴비가 decltype.. 귀하네요
책에서 decltype 소개해주는거 보니까 개편하던데? 뉴비들 보통 잘 안씀? - dc App
뉴비면 존재자체를 모르지
decltype(c) 말고 걍 auto 쓰면 안댐?