1#include <iostream>
2
3using namespace std;
4
5int main()
6{
7 wcout << (wchar_t)0x41 << endl;
8 return 0;
9}
1#include <iostream>
2using namespace std;
3int main() {
4 char grade = 'B';
5 cout << "I scored a: "<<grade;
6 return 0;
7}
8
1#include <iostream>
2using namespace std;
3
4int main()
5{
6 char* name = "Raj"; //can store a sequence of characters.
7 const char* school = "oxford";
8 //school[0] = 'O'; //gives runtime error. We can't modify it.
9 cout << name<<" "<<school;
10
11 return 0;
12}
1isdigit() - Check if character is decimal digit
2isalpha() - Check if character is alphabetic
3isblank() - Check if character is blank
4islower() - Check if character is lowercase letter
5isupper() - Check if character is uppercase letter
6isalnum() - Check if character is alphanumeric
1// syntax:
2// char <variable-name>[] = "<string/char-you-want-to-store>";
3
4// example (to store 'Hello!' in the YourVar variable):
5char YourVar[] = "Hello!";
6
1
2// syntax:
3// char <variable-name>[] = { '<1st-char>', '<2nd-char>', ... , '<Nth-char>', '\0'};
4
5// example (to store 'Hello' in the YourVar variable):
6char YourVar[] = {'H','e','l','l','o','\0'}; // NOTE: the \0 marks the end of the char array
7