Are struct and union composite data types or user-defined data types?

Debojit Acharjee 435 Reputation points
2023-06-01T13:40:30.34+00:00

I want to know whether struct and union composite data types or user-defined data types?

What is the difference between a composite and user-defined data types?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,883 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,641 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,633 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 61,491 Reputation points
    2023-06-01T15:13:39.58+00:00

    A user defined type is any type that is not built in. You can use enum, typedef, struct, and union to define a user defined type.

    a composite type, is a type that holds multiple types. A struct or a union can define a composite type.

    0 comments No comments