Top "Sizeof" questions

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

sizeof(int) on x64?

When I do sizeof(int) in my C#.NET project I get a return value of 4. I set the project …

c# 64-bit clr sizeof
When a function has a specific-size array parameter, why is it replaced with a pointer?

Given the following program, #include <iostream> using namespace std; void foo( char a[100] ) { cout << "foo() " <&…

c++ arrays standards sizeof function-parameter
Why does sizeof(x++) not increment x?

Here is the code compiled in dev c++ windows: #include <stdio.h> int main() { int x = 5; printf("%d …

c sizeof
Is sizeof in C++ evaluated at compilation time or run time?

For example result of this code snippet depends on which machine: the compiler machine or the machine executable file works? …

c++ runtime sizeof compile-time
How can I print the result of sizeof() at compile time in C?

How can I print the result of sizeof() at compile time in C? For now I am using a static …

c sizeof compile-time
sizeof class with int , function, virtual function in C++?

This is an online C++ test question, which has been done. #include<iostream> using namespace std; class A { }; …

c++ class object virtual sizeof
sizeof empty structure is 0 in C and 1 in C++ why?

Possible Duplicates: Empty class in C++ What is the size of an empty struct in C? I read somewhere that …

c++ c struct sizeof
In C, why is sizeof(char) 1, when 'a' is an int?

I tried printf("%d, %d\n", sizeof(char), sizeof('c')); and got 1, 4 as output. If size of a character is …

c size char int sizeof
implementation of sizeof operator

I have tried implementing the sizeof operator.. I have done in this way.. #define my_sizeof(x) ((&x + 1) - &…

c linux gcc sizeof typecast-operator
Why is sizeof considered an operator?

Why is sizeof considered an operator and not a function? What property is necessary to qualify as an operator?

c operators sizeof