Characters in Fortran
In Fortran, the alphanumeric (character) variables must have a specific length when declared. For example, let's see the following declarations: character(len=10) :: name, surname character :: firstLetter character(16) :: nickname The above declarations define two 10-character variables (name and surname), one 1-character variable named firstLetter and a 16-character variable named nickname. The older FORTRAN 77 syntax for the 'nickname' variable would be: character*16 nickname This form of type declaration statement has been declared OBSOLESCENT in Fortran 95 and should never be used in any new programs. Character literals Character literals are either between single or double quotes. If a character string is between simple quotes and includes an apostrophe then the apostrophe may be represented by two single quotes. The two following examples are equivalent: phrase = 'Man''s best try' phrase = "Man's best try" Depending on the case, single or...