DEV Community

Cyprian
Cyprian

Posted on

What is the difference btwn Data Types & Data Structures?

Discussion (2)

Collapse
raynayx profile image
raynayX

Data types refer to the kind of data being stored thus helping
the compiler/interpreter enforce the kind of operations possible on the data.
Example: numbers(broadly speaking) will allow arithmetic operations while strings will not.

On the other hand, data structures refer to the way data is organized in memory. For example, the array data structure allows data to be stored in a contiguous manner in memory.

Collapse
cyprian_dev profile image
Cyprian Author

You are very correct mate 👍..thank you.