Strings ๐งต#
A character is a symbol.
In C, a character is written in single-quotes (''
) surrounding the character.
Ex.
'#', 'a', 'b', '9'
A string is a sequence or โstringโ of characters. Strings are basically pieces of text.
In C, a string is written as double-quotes ("
) surrounding some text.
Ex.
"the quick brown fox",
"it costs $599",
"the weather today is nice"
Tasks ๐ฏ#
Create a string containing your name.
Solution โ
"John Smith"
Create a charcter of the first letter of โappleโ.
Solution โ
'a'