GCSE · Computer Science · Eduqas · Spec C500QS
Character data type
A ? and a space are both characters, and a 7 held as a character is not a number you can add up. Odd? Let's sort it out.
Computer Science · Data types
One character, or more?
Which data type is the suitable choice for each item? Ask yourself: will it ALWAYS be exactly one character?
Still to sort
Character (char) (0)
Always exactly one character: never two, never none.
Where the line is: The test is 'could it ever be longer than one character?' If the answer is yes, it is not a character job.
String (0)
Could be longer than one character. A sequence of characters of any length.
Where the line is: Even when today's value looks short, data that could be longer needs a string.
Sort each item of data into the type that suits it. Commit first, then read the reason.
Predict, then check
Commit to a prediction before you see the answer.
A programmer stores a player's name, such as Priya, in a variable meant for the character data type. What is the best prediction?
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
One character, or a whole string of them? Learn the one question that decides.
What you need to know
- A data type defines the kind of data a computer can store and the actions that can be performed on it.
- The character data type, char for short, holds a single character, like the letter a.
- That one character may be a letter, a digit, a symbol (like ?) or a space.
Have a goYour friend Sam is very confident: 'A character has to be a letter, so a ? can never be one.' Is Sam right?
No. A ? is a symbol, and a symbol is a perfectly good character.
A character can be a letter, a digit, a symbol or a space, so it is not limited to letters.
- A digit held as a character is text, not a number, so it is not used directly in arithmetic.
- Character is the suitable choice when data is always exactly one character, such as a Y or N reply.
Have a goA bus app stores one letter for each route: A, B or C. It is always one letter. Character or string?
Character.
Data that is always exactly one character is what the character type is suitable for.
- Data that can be longer than one character, like a name or a password, needs a string.
- A string holds text, which can include letters, numbers and symbols, as a sequence of characters of any length.
Have a goWhich one needs a string: the symbol # or the word hello?
The word hello.
A character holds exactly one character, and hello is five, so it needs a sequence of any length: a string.
- So the deciding question is: will it always be exactly one character? If it could be longer, use a string.
- Using an incorrect data type can lead to errors in a program.
The big picture
A data type defines the kind of data a computer can store and the actions that can be performed on it. The character type holds exactly one character (a letter, digit, symbol or space), while a string is a sequence of characters of any length. Ask 'will it always be exactly one character?' to choose, and remember that a digit held as a character is text, not a number.
Key points
Worked example
Problem
A school app stores two things about each pupil: their middle initial (for example K) and their tutor group (for example 10B). Choose the most suitable data type for each and say why.
⚠ Watch out
Treating the digit inside a character as a number. A 7 held as a character is text, and it is not used directly in arithmetic. A close second is choosing character for anything short. Short is not the test: 'always exactly one character' is.
Memory hook
Char is one seat. A string is the whole row. If the data might ever need a second seat, it is a string.
Check yourself
Cover the page. A ticket app stores a seat-row letter (always A to F) and a customer's full name. Which type for each, and why?
Flashcards
(10)What does a data type define?
What does the character (char) data type hold?
What can that single character be?
A 7 is held as a character. Number or text?
When is the character type the suitable choice?
Which type does a name or a password need, and why?
What is a string?
How does a character differ from a string?
Which question decides between character and string?
What can happen if you use the wrong data type?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore Eduqas GCSE Computer Science topics
How this lesson was checked. This Eduqas GCSE Computer Science (specification C500QS)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 16 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.