Hi all,
I'm beginner in c++, I'm trying practice on c++ basics, since few minutes I tried practice "setw" operator, I wrote this trivial program to print some data in console screen, but when I tried build it it gave me error..!
//print game names and my prefer rating in table
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
char g01='Excellent';
char g02='Good';
char g03='Bad';
cout << "Game: " << setw(10) << "My Rate" << endl
<< "Hitman 4 " << setw(10) << g01 << endl
<< "Infernal " << setw(10) << g02 << endl
<< "Harry potter 2 " << setw(10) << g03 << endl;
return 0;
}
------ Build started: Project: iammfa07_setw, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\users\iammfa\documents\visual studio 2008\projects\iammfa07_setw\main.cpp(7) : error C2015: too many characters in constant
c:\users\iammfa\documents\visual studio 2008\projects\iammfa07_setw\main.cpp(8) : warning C4305: 'initializing' : truncation from 'int' to 'char'
c:\users\iammfa\documents\visual studio 2008\projects\iammfa07_setw\main.cpp(8) : warning C4309: 'initializing' : truncation of constant value
c:\users\iammfa\documents\visual studio 2008\projects\iammfa07_setw\main.cpp(9) : warning C4305: 'initializing' : truncation from 'int' to 'char'
c:\users\iammfa\documents\visual studio 2008\projects\iammfa07_setw\main.cpp(9) : warning C4309: 'initializing' : truncation of constant value
Build log was saved at "file://c:\Users\iammfa\Documents\Visual Studio 2008\Projects\iammfa07_setw\Debug\BuildLog.htm"
iammfa07_setw - 1 error(s), 4 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
can someone help beginner before despair..:(
regards
iammfa