C++ 문자열

1 개요[ | ]

C++ string
C++ 문자열
#include <iostream>
using namespace std;

int main() {
    string s = "foo";
    cout << s.length(); // 3
}
#include <iostream>
using namespace std;

int main() {
    string s = "foo";
    cout << "s[0]=" << s[0] << ", " << (0+s[0]) << endl;
    cout << "s[1]=" << s[1] << ", " << (0+s[1]) << endl;
    cout << "s[2]=" << s[2] << ", " << (0+s[2]) << endl;
    cout << "s[3]=" << s[3] << ", " << (0+s[3]) << endl;
    cout << "s[4]=" << s[4] << ", " << (0+s[4]) << endl;
    cout << "s[5]=" << s[5] << ", " << (0+s[5]) << endl;
}

2 멤버 함수[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}