So, I can initialize a string in Fortran with both
CHARACTER(LEN=4)::string
string = "jklm"
and
CHARACTER(LEN=4)::string
string = 'jklm'
What's the difference?
At a glance of the fortan docs, it seems the same for the most part. Though if you plan to use a single quote within a string, use a double quote to enclose it.
// correct
"John's Stuff"
// wrong
'John's Stuff'
Alternatively:
// correct
'She said "Hey!"'
// wrong
"She said "Hey!""
http://www.fortran90.org/src/rosetta.html#strings-and-formatting
Edit: btw, same goes for most programming languages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With