Answered step by step
Verified Expert Solution
Link Copied!

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. 1
  2. 4
  3. 8
  4. 13

11. Which operator can you use to retrieve the address of a variable?

  1. &
  2. *
  3. ->
  4. !

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;

}

  1. printf(%d , myStruct.x);
  2. printf(%d , *(px));
  3. printf(%d , px);
  4. printf(%d , *p);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

978-0764535376

More Books

Students also viewed these Databases questions

Question

Stages of a Relationship?

Answered: 1 week ago