Answered step by step
Verified Expert Solution
Question
1 Approved Answer
10. Your program includes the following declarations: union Code { char c; short n; double f; }; union Code myCode; Assuming that a char requires
10. Your program includes the following declarations:
union Code
{
char c;
short n;
double f;
};
union Code myCode;
Assuming that a char requires 1 byte, a short requires 4 bytes, and a double requires 8 bytes, how much memory will the myCode variable require?
- 1
- 4
- 8
- 13
11. Which operator can you use to retrieve the address of a variable?
- &
- *
- ->
- !
12. Select equivalent statements to print value of x from below options.
struct def{
int x;
float y;
};
void main(){
struct def myStruct;
struct def *p = &myStruct;
myStruct.x = 25;
myStruct.y = 1.23;
}
- printf(%d , myStruct.x);
- printf(%d , *(px));
- printf(%d , px);
- printf(%d , *p);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started