flâneur — a map of the web's best reading

C/C++ data types, basic operators, and control structures

courses.washington.edu · 515 words · saved by 1 readers

C/C++ data types, basic operators, and control structures Data types Data types in C++ are similar to Java. There are ints, floats, doubles, etc. In C++ it's bool instead of boolean. There are long and short ints although you are not assured of the number of bytes for each. There are also signed and unsigned ints. Unsigned ints can only hold ints >= zero. Some operations are not completely defined, e.g., division involving negative numbers, so it is possible to get different answers using different compilers. You shouldn't have problems though with the computations in your courses. Characters are similar with literals in single quotes. The char type in C++ does not have a specified byte size although they are typically stored in 8 bits. String terminology can be ambiguous. There is a string class with all the usual functionality, but C/C++ programmers also refer to char arrays as strings. If you have an array of char, always store the NULL character, '\0' as the final character of t

C/C++ data types, basic operators, and control structures C/C++ data types, basic operators, and control structures Data types Data types in C++ are similar to Java. There are ints, floats, doubles, etc. In C++ it's bool instead of boolean. There are long and short ints although you are not assured of the number of bytes for each. There are also signed and unsigned ints. Unsigned ints can only hold ints >= zero. Some operations are not completely defined, e.g., division involving negative numbers, so it is possible to get different answers using different compilers. You shouldn't have problems

Explore this link on the map →

related reading