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

前端 未结 5 605
花落未央
花落未央 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条回答
  •  遥遥无期
    2020-12-17 04:30

    Composite types are derived from more than one primitive type (chars, ints, boolean, etc). This can be done in a number of ways. The ways they are combined are called data structures.

    Therefore, your character array in C is a composite data type and a data structure. In general, to make your life and the lives around you easier, you can see a data structure as a generic term.

提交回复
热议问题