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++ 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,

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

Syntax:

??=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

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.