An Interest In:
Web News this Week
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
April 27, 2022 10:35 am GMT
Original Link: https://dev.to/flaneuroffc/c-variables-4b0i
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:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To