Which lines of the following code contain compilation errors, if any?
#include <iomanip>
#include <iostream>

using namespace std;

int main()
{
   const int size = 5;  // 1
   char name[size];  // 2

   cout << "Enter your name: ";
   cin >> setw(size) >> name;  // 3
   cout << "Hello, " << name << "! "  // 4
       "Welcome to C++" << endl;  // 5

   return 0;
}
Explanation
std :: setw - sets the number of characters to be used as the field width for the next insertion operation.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести