C++

sizeof

Në shqip përdoret i njëjti emër.

ShpjegimiSQ

sizeof të tregon sa bajt zë një tip ose variabël në memorie — p.sh. sizeof(int) zakonisht është 4, sizeof(double) 8. Ndihmon të kuptosh sa memorie përdor programi.

EnglishEN

sizeof tells you how many bytes a type or variable takes in memory — for example sizeof(int) is usually 4, sizeof(double) 8. It helps you understand how much memory your program uses.

Si ta mendosh

Si ta matësh sa vend zë një valixhe para se ta futësh në bagazh.

Lexoje në anglisht

Like measuring how much space a suitcase takes before putting it in the boot.

Shembull kodicpp

std::cout << sizeof(char);    // 1
std::cout << sizeof(int);     // 4
std::cout << sizeof(double);  // 8

Terma të lidhur