Mastery 09

In order to receive points for this mastery, you must descibe basic types and their uses.

In C++ there are not many basic types. These basic types incude:

     void, int, float, double, char, string, and, bool

and other more specific variations of the 7 listed.

– The ‘void’ type is used for fucntions and it makes the fucntion not have a number value. As seen on the test for Partial 2 the triangle function must be a void function because i does not hold any numerical values

– An ‘int’ type creates an integer number, meaning the ‘int’ type does not hold any decimals

– A ‘float’ type is another type which holds a number but different than the ‘int’ it is able to hold decimal values

– A ‘double’ type is very similar to the ‘float’ type except it is able to hold more decimals making the caluclations more accurate

– A ‘char’ type is a type which hold letters and variables but no number values

– A ‘string’ type is a type which can hold, numbers, letters, and variables which can be reacalled individually

– A ‘bool’ type is a type which is commonly used to evaluate a function only if the statement given is true

Most of these basic types are able to have other modifications. For example the ‘char’ type only holds only letter or variable but there are other ‘char’ types which are able to hold more values.

I hope this breif summary has given you a better grasp on the meanings and uses of the basic C++ types

CC BY 4.0 Mastery 09 by Asa Puls is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.