×

C++ Tutorial

C++ Data types

C++ Operators & Keywords

C++ Conditional Statements

C++ Functions

C++ 'this' Pointer, References

C++ Class & Objects

C++ Constructors & Destructors

C++ Operator overloading

C++ 11 (Advance C++)

C++ Preparation

C++ Header Files & Functionsr

Data Structure with C++

C++ - Miscellaneous

C++ Programs

Trigraph Sequences in C++ programming

C++ | Trigraph Sequences: In this tutorial, we are going to learn about the various trigraph sequences with examples in C++ programming.
Submitted by IncludeHelp, on June 18, 2020

Trigraph Sequences in C++

Trigraph Sequences in C++ are the set of three characters starting from double question marks (??). These set of the characters replaces by a single character specified in the below table.

List of Trigraph Sequences in C++

Trigraph Replacement
??= #
??/ \
??' ^
??( [
??) ]
??! |
??< {
??> }
??- ~

Syntax of Using Trigraph Sequences in C++

??=define

Becomes,
#define

C++ program of trigraph sequences

// C++ program to demonstrate the example 
// of trigraph sequences

# include <iostream>
using namespace std;

??=define MSG "Hello, world!"
??=define COUNTRY "INDIA"

int main()
??<
    cout << "My message is: " << MSG << endl;
    cout << "My country is: " << COUNTRY << endl;
    
    return 0;
??>

Output

My message is: Hello, world!
My country is: INDIA

Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.