A-level Computing/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Fundamentals of Programming/Data types

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Data in computer is all stored as bit patterns, i.e. in binary. In programming, we need to specify the data type so the computer treats each bit pattern correctly. For example not allowing a user to put a name in a date of birth, or the colour of someone's scarf into someone's age. They also serves the useful purpose, if used correctly, of producing the smallest program files possible. If you use them incorrectly, you might have issues with your code! There are two types of data type that you need to know