Sekuencat "escape"
Sekuencat e largimit ( escape sequences) quhen ndryshe dhe sekuenca te pashkruajtshme. Sherbejne per te kryer veprime te ndryshme ne afishim. fillojne me \ (backslash)
\n - newline ( Kalon kursorin ne rresht te ri )
\t - tab , vendos nje hapesire sa tab-i
\b - backspace, fshin karakterin e fundit
\\ - printon nje \
\" - printon nje thonjze dyshe"
\' - printon nje thonjze teke '
\a - alarm (beep)
\r - carriage return, vendos kursorin ne fillim te rreshtit aktual
// demostrimi i "escape sequences"
#include <iostream>
int main()
{
std::cout << "newline\n\n";
std::cout << "kjo\teshte\tnje\tprove e\ttab-it\n";
std::cout<<"******** return\rcarriage\n";
std::cout<<"bb\backspace\n";
std::cout <<"thonjeza dyshe:\"\"\n";
std::cout <<"thonjeza teke:\'\'\n";
std::cout <<"backslash:\\\n";
std::cout<<"5 alarm \a\a\a\a\a\n";
system ("pause");
return 0;
}
Afishon:
newline
kjo eshte nje prove e tab-it
carriage return
backspace
thonjeza dyshe:""
thonjeza teke:''
backslash:\
5 alarm
Press any key to continue . . .
Per te eleminuar prefiksin std:: perpara cout, cin, endl perdoren instruksionet:
using std::cout;
using std::cin;
using std::endl;
pas direktives se preprocesorit #include <iostream>
ose
using namespace std;