Class 18: Assorted Topics Flashcards

1
Q

What holds for any data type <DT>

A

If you use the & operator on a variable of data type <DT> then the data type of the result is <DT>+ *

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What happens is you use * operator on a variable of data type <DT>

A

The data type of results is <DT>-*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Int a; <DT> = int
&a. <DT> +*
Can a be dereferenced?

A

No because data type does not contain *

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Int *a <DT> = int *
&a. <DT> + *
a. <DT> -

A

Example problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Little median

A

Least significant byte is stored first in memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Consider the structure

Struct prob{
Int k;
Int j;
Int a[2];
Int *p;
};

What is the size of this struct?

A

Two 4-byte values (int)
A two-element array of type in
8 byte integer pointer for a total of 24 bytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Union

A

All field reference same block of memory rather than different blocks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Size of this union

Union {
Int b;
Char y[4];
}

A

Size of union is 4 bytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do we get size of union

A

The size of union is taken according to the size of the largest member in union

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Big Endian

A

Most significant byte is stored first in memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly