I'm just starting out on Fortran and am confused with the usage of double vs single quotation marks.
General Usage Rules In America, Canada, Australia and New Zealand, the general rule is that double quotes are used to denote direct speech. Single quotes are used to enclose a quote within a quote, a quote within a headline, or a title within a quote.
If you're referring to what happens when you echo something, the single quotes will literally echo what you have between them, while the double quotes will evaluate variables between them and output the value of the variable.
Single quotation marks are also known as 'quote marks', 'quotes', 'speech marks' or 'inverted commas'. Use them to: show direct speech and the quoted work of other writers. enclose the title of certain works.
The most common reason to use single quotation marks is to quote someone who is quoting someone else. The rules are different in British English, but in American English, you enclose the primary speaker's comments in double quotation marks, and then you enclose the thing they are quoting in single quotation marks.
They are equivalent. There is no difference in their usage.
You can employ this to print one of the quotation characters:
print *, "'"
print *, '"'
prints first '
and then "
.
Note: You can also use two quote characters in a row to print one:
print *, """"
print *, ''''
prints first "
and then '
.
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