+ 2
I want to explain about the type of variable char in C++?
.
4 Answers
+ 10
Salam Tamam Kasm ,
here is link to a short sololearn tutorial about *char* type. see also the other links about *data types* and *variables*:
it is also recommended to practice what you have learned.
https://www.sololearn.com/learn/CPlusPlus/1623/?ref=app
https://www.sololearn.com/learn/CPlusPlus/1621/?ref=app
https://www.sololearn.com/learn/CPlusPlus/1606/?ref=app
+ 4
Char: delimited by single commas (â â). Just a sigle character. Example: âaâ.
String: delimited by double commas (â â). An array of characters. Example: âhelloâ.
In C we declare strings as an array of chars: char arr[10] = âHelloâ;
This is the fundamental difference.
+ 4
A char is a data type that represents a single character. It is one byte in size (on most systems).
We can utilise char arrays to make C-styled strings, such as const char* greeting = "Hello, Salam!";
Generally for strings, we should use
std::string as it has been well tested and has a wide range of useful functionality.
If you would like more help or more information, please feel free to let me know, I would be more then glad too!
+ 3
Salam Tamam Kasm i believe this should help
https://www.sololearn.com/discuss/243505/?ref=app