setw() and named constants
How do you get setw() to work with named constants?
I tried the following, but it isn't working.
#include <iostream> //Header file that contains cout and endl
#include <string> //Header file that contains string commands
#include <iomanip> //Header file that contains setw() function
const string FIRST = "John"; //Person's First Name
const string LAST = "Doe"; //Person's Last Name
int main()
{
cout << setw(4) << FIRST << setw(4) << LAST <<endl;
return 0;
}
Desired output:
John Doe
----
Thanks!