안녕하세요. 궁금증연구소입니다. 오늘 포스팅 주제는 "[c++] string.begin()의 포인터와 string name의 포인터는 다르다."입니다. #include #include #include using namespace std; main() { string name = "abc"; printf("%d\n", name); printf("%d", name.begin()); } c++에서는 string 객체를 제공합니다. 따라서 c에서 존재하는 문자열을 다루는 어려움이 많이 해소됩니다. string객체의 메서드 중에는 begin() 메서드가 존재하는데, 객체에 저장된 문자열의 첫 번째 위치(포인터)를 리턴해줍니다. 위 예를 보면 name string 객체에 문자열 abc를 저장 후, begin()을 ..