본문 바로가기

main

검색하기
main
프로필사진 1984

  • 분류 전체보기 (228)
    • Java (21)
      • Spring (11)
    • Python (8)
    • C | C++ (3)
    • Algorithm (127)
    • ETC (69)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
일 월 화 수 목 금 토
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
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록C | C++ (3)

main

[C++] 문자열 소문자-대문자 변환

* 아스키 코드를 사용한다. * 대문자 - 소문자 간에 아스키 코드 10진수 값 차이가 32 임. 대문자 -> 소문자 for (auto &item : str) { if ('A'

C | C++ 2022. 1. 30. 23:31
[C ++] 문자열 공백 제거

코드 #include #include #include using namespace std; int main(void) { string str = "str ing"; str.erase(remove(str.begin(), str.end(), ' '), str.end()); cout

C | C++ 2022. 1. 30. 23:13
[C++] warning C4804: '>': unsafe use of type 'bool' in operation

에러 warning C4804: '>': unsafe use of type 'bool' in operation 원인 // 잘못된 문법이다. if(a < x < b) // 사실상 아래와 같다. if((a < x) < b) // 즉 boolean < b 의 형태이므로 error 발생한다. if (boolean < b) 해결방법 // 아래와 같이 작성한다. and operator(&&) 사용 if(a < x && x < b) [참고 자료] https://stackoverflow.com/questions/42552877/why-the-warning-c4804-unsafe-use-of-type-bool-in-operation-is-popping

C | C++ 2022. 1. 30. 22:58
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바