How to type single quotes in C++籽

In C++, single quotes are used to represent character constants. To use single quotes in C++, simply place the character between two single quotes.

For example, to print the character ‘A’, you can use the following code:

#include <iostream>

int main() {
    char ch = 'A';
    std::cout << ch << std::endl;

    return 0;
}

This program will output the character ‘A’.

bannerAds