Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 27, 2022 10:35 am GMT

C Variables

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 -123double - stores floating point numbers, with decimals, such as 19.99 or -19.99char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotesstring - stores text, such as "Hello World". String values are surrounded by double quotes

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.


Original Link: https://dev.to/flaneuroffc/c-variables-4b0i

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To