Strings are one-dimensional arrays containing characters. In most cases the number of characters a string has will vary, depending on the input. Thus they must be declared with the maximum number of characters that is likely to occur. Typically they are used to store names. They can also be used when numeric values are entered into a program. With this the program reads the value as a string of characters and then converts it into the required numeric format. This allows the program to determine if the user has entered the value in an invalid numeric format, such as with letters.
Unable to display preview. Download preview PDF.