Top "Sizeof" questions

sizeof refers to the Standard C/C++ operator for returning the size in bytes of an expression or datatype.

How can I get sizeof a vector::value_type?

I want to get sizeof of the type that is contained in a vector. Here is what I tried: #include &…

c++ c++11 vector sizeof value-type
get size of populated dictionary

I would like to get the size of a populated dictionary in python. I tried this: >>> dict = {…

python dictionary sizeof content-length
Can sizeof return 0 (zero)

Is it possible for the sizeof operator to ever return 0 (zero) in C or C++? If it is possible, is …

c++ c sizeof
How sizeof(array) works at runtime?

I have read that sizeof operator in C is interpreted at compile time and since at compile time compiler knows …

c sizeof
Loop through array of unknown size C++

I am trying to traverse a double array of an unknown size. Why does the following not work? for (unsigned …

c++ arrays for-loop sizeof function-definition
C: Why isn't size_t a C keyword?

sizeof is a C keyword. It returns the size in a type named size_t. However, size_t is not …

c types sizeof size-t
What if a null character is present in the middle of a string?

I understand that the end of a string is indicated by a null character, but i cannot understand the output …

c null sizeof strlen
Size of empty vector

The following program on running with g++ 4.8.2 gave the output 12 on a 32-bit Linux system: vector<char> v; …

c++ vector iterator sizeof g++4.8
can I assume that sizeof(uint8_t) = 1?

I have a program that uses dynamic allocation for a uint8_t array; can I safely assume that its length …

c sizeof uint8t uint
Why does a lambda have a size of 1 byte?

I am working with the memory of some lambdas in C++, but I am a bit puzzled by their size. …

c++ c++11 lambda c++14 sizeof