DEV Community

flaneuroffc
flaneuroffc

Posted on

C++ Variables

#ok

Variables are containers for storing data values.

In C++, there are different types of variables (defined with different keywords), for example:

int - stores integers (whole numbers), without decimals, such as 123 or -123
double - stores floating point numbers, with decimals, such as 19.99 or -19.99
char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes
string - stores text, such as "Hello World". String values are surrounded by double quotes
Enter fullscreen mode Exit fullscreen mode

The setfill() method of Iomanip library in C++ is used to set the ios library fill character based on the character specified as the parameter to this method.

Setw function is a C++ manipulator which stands for set width. The manipulator sets the ios library field width or specifies the minimum number of character positions a variable will consume.

Top comments (0)