====== C++ Labyrinth #1 ====== ===== Code ===== #include #include using namespace std; class A { public: A () {}; operator string() { return "It's A!"; }; }; class B { public: B () {}; B (const A& temp) {}; operator string() { return "It's B!"; }; }; int main() { A a; B b; string sTemp = (true ? a : b); cout << "What do you expect?" << endl; cout << "Unfortunately, " << sTemp << endl; return 0; } ===== Problem ===== 위 코드를 실행했을 때 예상되는 출력 결과를 리플로 달아주세요. - 위 코드는 gcc 3.3.5 에서 -Wall 옵션과 함께 워닝이나 에러없이 컴파일됩니다. - 위 코드를 컴파일하고 실행해 본 후 리플을 다시면 안되는거 아시죠? ㅠㅠ - 정답과 관련된 이야기는 다른 분들을 위해 [[wiki:cpp_labyrinth_1|정답 관련 토론]]에 달아주세요. {{tag>programming}} ~~DISCUSSION~~