Java tipe data C plus plus

www.lau‮c.irutt‬om
Java tipe data C plus plus

C++ is a programming language that is similar to, but distinct from, the Java programming language. C++ and Java have some similarities in syntax and structure, but they have many differences in terms of their features, libraries, and implementation.

In C++, there are several basic data types that can be used to store values in variables. Some of the most common C++ data types are:

  • int: This data type is used to store integers (whole numbers) in the range of -2147483648 to 2147483647.

  • float: This data type is used to store floating-point numbers (numbers with a decimal point) in single precision.

  • double: This data type is used to store floating-point numbers in double precision.

  • char: This data type is used to store a single character.

  • bool: This data type is used to store a boolean value (true or false).

In C++, you can also define your own data types using the typedef keyword, which allows you to create an alias for an existing data type. For example, you can use typedef to define a string data type as an alias for a char array:

typedef char string[256];

In this example, the string data type is defined as an alias for an array of char with a size of 256. You can then use the string data type in the same way you would use an array of char.

It's important to note that C++ also has a wide range of advanced data types, such as pointers, references, and user-defined types (such as classes and structs), which are not available in Java. If you are familiar with Java and are learning C++, it's important to understand the differences between the two languages and be aware of the features and capabilities of C++ that are not present in Java.

Created Time:2017-10-17 20:18:54  Author:lautturi