달리 앱에서 string 에 int형 변수를 포함시키고 싶습니다.
string 을 편집하는 다른 방법이 있나요?(stdlib의 itoa 같은 함수가 있나요?)
void HelloWorldExample::Create( Application& application ) { TableView tableView = TableView::New( 4, 4 ); tableView.SetKeyboardFocusable( true ); tableView.SetParentOrigin( ParentOrigin::CENTER ); tableView.SetSize( 300, 300 ); for( int row = 0; row < 4; ++row ) { for( int col = 0; col < 4; ++col ) { std::ostringstream str; str << row << "-" << col; TextLabel textLabel = TextLabel::New( str.str() ); textLabel.SetKeyboardFocusable( true ); textLabel.SetBackgroundColor( Color::WHITE ); tableView.AddChild( textLabel, TableView::CellPosition( row, col ) ); } } Stage::GetCurrent().Add( tableView ); }
위 예제를 적용하려고하면 implicit instantiation of undefined template 'std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'라는 에러를 발생시킵니다.