C ++中基本数据类型与派生数据类型之间的区别

在编程中,数据类型表示打算由用户使用的数据的类型和性质。它是编译器或解释器要处理的数据类型,并在主存储器中提供相应的存储位置。

现在根据数据的性质,数据类型主要有两种类型,一种是基本数据类型,另一种是派生数据类型。这两种数据类型都在编程中使用,并且在需要对数据实施业务逻辑时同样重要。

以下是基本数据类型和派生数据类型之间的重要区别

序号基本数据类型派生数据类型
1个定义As name suggests Fundamental data type is the data type which is concrete and is introduced by the language itself i.e it has its own fundamental characteristics and properties along with some fundamental methods to perform operations over them.另一方面,派生数据类型是由基本数据类型组成的数据类型,这意味着它们是从基本数据类型派生的,除了基本数据类型之外,还具有一些其他属性或已修改的属性。
2实作Fundamental data types in any language are implemented in concrete form i.e there are fixed fundamental data type in each language for instance in C++ character, integer, float, and void are fundamental data types.另一方面,编程中的“派生数据”类型以抽象实现方式实现,因为它们的定义由用户定义,他们要处理的数据类型(例如指针,数组,结构和联合)是派生数据类型。
3数据Character data type is used for store characters and can be classified as char, Signed char, Unsigned char.另一方面,指针用于存储变量的地址,而不是存储变量的值。
4分配Integer is used for assignment and storing of integers( not having decimal digits) and can be classified as signed and unsigned. Further classified as int, short int and long int.另一方面,在派生数据类型的情况下,Array用于包含相似的数据类型,它可能具有字符,整数,浮点数甚至是用户定义的数据类型。
5性能If case of fundamental data type only type and nature of data is concern so there in no issue of time complexity as we deals with the concrete implementation of the language.另一方面,在派生数据类型的情况下会出现时间复杂性,因为它主要处理对其存储的数据进行逻辑处理和执行。