Character Codes & String Conversion Flashcards
All 4 cards in this deck
What is a string conversion (casting)?
Converting a value from one data type to another, e.g.
STRING_TO_INT('25')converts the string '25' to the integer 25.Why does keyboard input often need converting before it is used in a calculation?
In most languages keyboard input is read as a string, so it must be converted to an integer or real (e.g. with
STRING_TO_INT) before arithmetic is done on it.Which AQA pseudo-code functions convert between strings and numbers?
STRING_TO_INTandSTRING_TO_REALconvert a string to a number;INT_TO_STRINGandREAL_TO_STRINGconvert a number to a string.What do
CHAR_TO_CODEandCODE_TO_CHARdo?e.g. given that the character code for 'A' is 65:
CHAR_TO_CODE('A')andCODE_TO_CHAR(66)CHAR_TO_CODEreturns the character code of a character andCODE_TO_CHARreturns the character for a code, giving65and'B'.