Top "Sizeof" questions

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

Result of 'sizeof' on array of structs in C?

In C, I have an array of structs defined like: struct D { char *a; char *b; char *c; }; static struct …

c arrays struct sizeof
Why isn't the size of an array parameter the same as within main?

Why isn't the size of an array sent as a parameter the same as within main? #include <stdio.h&…

c arrays function sizeof
Size of pid_t, uid_t, gid_t on Linux

On Linux systems (either 32- or 64-bit), what is the size of pid_t, uid_t, and gid_t?

c linux 64-bit 32-bit sizeof
memcpy(), what should the value of the size parameter be?

I want to copy an int array to another int array. They use the same define for length so they'll …

c arrays sizeof memcpy
What is the return type of sizeof operator?

What is the return type of sizeof operator? cppreference.com & msdn says sizeof returns size_t. Does it really …

c++ visual-studio-2010 sizeof
What is the size of void?

What would this statement yield? void *p = malloc(sizeof(void)); Edit: An extension to the question. If sizeof(void) yields 1 …

c++ c language-lawyer sizeof
sizeof a union in C/C++

What is the sizeof the union in C/C++? Is it the sizeof the largest datatype inside it? If so, …

c++ c sizeof unions
Get size of pointer in C

How do I get the size of a pointer in C using sizeof? I want to malloc some memory to …

c pointers sizeof
Best practice for getting datatype size(sizeof) in Java

I want store a list of doubles and ints to a ByteBuffer, which asks for a size to allocate. I'd …

java sizeof
sizeof single struct member in C

I am trying to declare a struct that is dependent upon another struct. I want to use sizeof to be …

c struct sizeof