Struct(s)
{
int a;
long b;
}
Union (u)
{int a;
long b;
}
Print sizeof(s)and sizeof(u) if sizeof(int)=4 and
sizeof(long)=4
Answers were Sorted based on User's Feedback
Answer / jack
I assume above code to be correctly written as below:
struct s
{
int a;
long b;
}
Union u
{int a;
long b;
}
sizeof(s)= 8
sizeof(u) = 4
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / vikraman85
Size fo strucure wil be the total bytes of the datatypes
inside it..
so,4+4=8;
For unions the size wi be the size of the datatype whose
memory is high,.
so,its 4,.
| Is This Answer Correct ? | 7 Yes | 0 No |
what is the first address that gets stored in stack according to a C or C++ compiler???? or what will be the first address that gets stored when we write a C source code????????
main() { printf(5+"Vidyarthi Computers"); }
Differentiate between Macro and ordinary definition.
How do you print an address?
inline function is there in c language?
What is a static function in c?
What is assert and when would I use it?
regarding the scope of the varibles;identify the incorrect statement: a.automatic variables are automatically initialised to 0 b.static variables are are automatically initialised to 0 c.the address of a register variable is not accessiable d.static variables cannot be initialised with any expression
Write a program to reverse a given number in c language?
What is int main () in c?
A program to allow an input operand and operator from the operator and read on the display and output operand.
What is the main differences between C and Embedded C?