下述程式示範了一些轉義序列。它使用振鈴字元來提請注意,使用換行符使光标前進,使用倒退字元使光标向左退一格
void bodini(void)
{
cout<<"\aOperation \"HyperHype\" is now activated!\n";
cout<<"Enter your agent code:_______\b\b\b\b\b\b";
long code;
cin>>code;
cout<<"\aYou entered "<<code<<"...\n";
cout<<"\aCode verified! Proceed with Plan Z3!\n";
}