1

this is what I have so far and I get an error: setw was not declared in this scope

void grid (void)
{
    for (int r = 0; r < 6; r++)
    {
        for (int c = 0; c < 6; c++)
        {
            cout << "-------------" << endl;
            cout << "|" << setw(4) << r + 1 << setw(4) << "|" << endl;
            cout << "-------------" << endl;
        }
    }
    cout << "-------------------------------";
}
Manos Nikolaidis
  • 21,608
  • 12
  • 74
  • 82
Shay
  • 19
  • 6

1 Answers1

0

setw is defined in iomanip not iostream. Therefore add this line to your source file:

#include <iomanip>
Manos Nikolaidis
  • 21,608
  • 12
  • 74
  • 82
  • i realized that and added it, however, the grid still isnt printing the way it should. is there anyway i can send a picture of how it should look? – Shay Oct 06 '15 at 18:59