printing 2d table (headers)

Posted by k0re on Stack Overflow See other posts from Stack Overflow or by k0re
Published on 2010-06-01T14:33:20Z Indexed on 2010/06/01 14:43 UTC
Read the original article Hit count: 97

Filed under:

Hi

Is there are a better way than this one to print 2d table?

  std::cout 
      << std::setw(25) << left << "FF.name"
      << std::setw(25) << left << "BB.name"
      << std::setw(12) << left << "sw.cycles"
      << std::setw(12) << left << "hw.cycles"  << "\n"
      << std::setw(25) << left << "------"
      << std::setw(25) << left << "------"
      << std::setw(12) << left << "---------"
      << std::setw(12) << left << "---------"  << "\n";

© Stack Overflow or respective owner

Related posts about c++