What is the difference between a composite data type and a data structure?

前端 未结 5 606
花落未央
花落未央 2020-12-17 04:20

I read that a character array in C is a composite data type because it is a sequence of characters, but then in Java a String is a class and Wikipedia says that a class is d

5条回答
  •  猫巷女王i
    2020-12-17 04:31

    Every Data Type is a Data Structure but nor every data structure is a data type.

    A data type is an entity that can hold data. A data type of the simplest form is a primitive data type. A more complex data type made up of primitive data types is a composite data type

    A Data structure becomes different from a data type when it hold Relationships between the entities stored, along with the entities. here the entities are the data types. but the data types together with the relationships form the data structure.

提交回复
热议问题