Escape Sequences
Escape Sequences keys ေတြကေတာ႔ output ေတြထုတ္ျပတဲ႔အခါမွာ ေနာက္တစ္လိုင္းဆင္းပါ ။ ပံုေလးေတြျပေပးၿပီးအမွတ္သားလုပ္ပါ ။ ဒီေနရာေရာက္ရင္ေတာ႔ tab ခံုေပးပါ စသျဖင္႔ေပါ႔ေလ ကိုယ္လိုတဲ႔ပံုစံေလးေတြျဖစ္ေအာင္ညႊန္ၾကားေပးနုိင္ဖို႔အတြက္သံုးပါတယ္ ။ေအာက္မွာေလ႔လာၾကည့္ပါ ။
Example Program
အေပၚမွာေပးထားတဲ႔ပံုအျပင္ ပရိုဂရမ္ဥပမာေလးပါျပ လိုက္ပါတယ္ ။ အေပၚကပံုေလးနဲ႔ Program code ေလးေတြကိုတြဲၿပီးေလ႔လာမယ္ဆိုရင္ နားလည္လိမ္႔မယ္လို႔ထင္ပါတယ္ ။Output ထုတ္တဲ႔အခါသိသာနိုင္ဖို႔အတြက္ တစ္ခါတည္း ဘာအတြက္ထုတ္တယ္ဆို ေရးေပးထားပါတယ္ ။
#include<iostream>
using namespace std;
void main()
{ cout<<"using (tab)"<<endl;
cout<<" Welcome From \t My Blog "<<endl;
cout<<endl;
cout<<endl;
cout<<"using(newline)"<<endl;
cout<<"How \nare \nyou ?"<<endl;
cout<<endl;
cout<<endl;
cout<<"using(Audible bell)"<<endl;
cout<<"How \a are \a you ?"<<endl;
cout<<endl;
cout<<endl;
cout<<"using(Formfeed)"<<endl;
cout<<"How \f are \f you ?"<<endl;
cout<<endl;
cout<<endl;
cout<<"using (Double quote )"<<endl;
cout<<"How \"are \"you ?"<<endl;
cout<<endl;
cout<<endl;
cout<<"using (Single quote)"<<endl;
cout<<"How \'are \'you"<<endl;
cout<<endl;
cout<<endl;
cout<<"using(Vertical tab)"<<endl;
cout<<"How \v are \v you"<<endl;
cout<<endl;
cout<<endl;
cout<<"using(Backslash)"<<endl;
cout<<"How \\ are \\ you"<<endl;
cout<<endl;
cout<<endl;
cout<<"using(Octal number (nnn))"<<endl;
cout<<"\3 How are you \6"<<endl;
cout<<endl;
cout<<endl;
cout<<"using(Carriage return)"<<endl;
cout<<"How \r are \r you "<<endl;
cout<<endl;
cout<<endl;
cout<<"using(Null character )"<<endl;
cout<<"How \0 are \0 you"<<endl;
cout<<endl;
cout<<endl;
cout<<"using(Hexadecimal)"<<endl;
cout<<"How are you \x4e"<<endl;
cout<<endl;
cout<<endl;
cout<<"using(Hexadecimal)"<<endl;
cout<<"How are you \?"<<endl;
cout<<endl;
cout<<endl;
cout<<"using (Backspace)"<<endl;
cout<<"How\b are\byou"<<endl;
}
Result
Code ေလးေတြကို ကိုယ္တုိင္ေရးၿပီးစမ္းၾကည့္ေစခ်င္ပါတယ္ ။ အဲဒါဆိုရင္ ဘယ္လိုအလုပ္လုပ္တယ္ဆိုတာ နားလည္ပါလိမ္႔မယ္ ။ အားလံုးပဲအဆင္ေျပပါေစ ။
ေဆြးေႏြးခ်က္ (၅)
Thursday, July 1, 2010
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment