1
콘솔 창에서 모든 출력을 네 개의 별도 필드로 채 웁니다. 모두 균등하게 간격을 둡니다. 그건 -콘솔에 서식 지정, C++
코드 위out << left << setw(24) << "Name" << "Location"
<< right << setw(20) << "Acres " << "Rating" << endl;
out << left << setw(24) << "----" << "--------"
<< right << setw(20) << "----- " << "------" << endl;
while (current_node)
{
out << left << setw(24) << current_node->item.getName() // equivalent tabs dont work?
<< current_node->item.getLocation() << right << setw(20)
<< current_node->item.getAcres()
<< " " << current_node->item.getRating()
<< endl;
current_node = current_node->nextByName;
}
어떤 이유로 setw가 (N)과 동일한 값 ...
가
out << left << setw (24) << "Location"<< "Location" << 오른쪽 << setw (20) << "Acres"<< "Rating"<< endl; \t out << left << setw (24) << "----"<< "--------" << 오른쪽 << setw (20) << "---- - "<<"------ "<< endl; 동안 (current_node) 밖으로 \t \t \t { << 왼쪽 << setw (24) << current_node-> item.getName는() // 등가 탭 작동 해달라고? \t \t \t << current_node-> item.getLocation() << 오른쪽 << setw (20) \t \t << current_node-> item.getAcres() \t \t \t \t \t << ''<< current_node- > item.getRating() \t \t \t << endl; \t \t current_node = current_node-> nextByName; \t} – user40120
램프 쉐이드, 읽기 : http://stackoverflow.com/editing-help – avakar
@avakar 필자는 주석에서 여러 줄의 코드 형식이 무시된다고 생각합니다. –