#include <string>
// Input
std::string firstName;
std::cin >> firstName;
// Assign, Append
firstName = "SH";
fullName += " Park";
// Concat
string firstName = "SH";
string lastName = "Park";
string fullName = firstName + " " + lastName;
// Compare
if (name1 > name2) // 사전 상 순서로 비교
{
}
// Methods
/// Size
cout << firstName.size() << endl; // 더 많이 씀
cout << firstName.length() << endl;
/// Convert string to char*
string line;
cin >> line;
const char* cLine = line.c_str();
/// Get
string firstName = "SH"
char letter = firstName[1];
firstName[1] = "K";
string step
heap 메모리 할당은 느림
메모리 단편화 문제 → 새로운 길어진 메모리 할당 실패
내부 버퍼 증가는 멀티 쓰레드에서 안전하지 않을 수도
C++를 쓰는 업계가 어디인지 생각할 것
→ 그래서 여전히 sprintf와 함께 char[]를 많이 사용