cs 261 quizzes before midterm
in C, a symbolic constant can be created using which preprocessor directive?
#define
Which x86-64 condition code register indicates that the previous instruction produced a negative result?
SF
what is a disassembler
a tool that parses an executable file to extract its instruction sequences
a pointer is a variable that stores what type of information
an address
the 1991 patriot/scud missile disaster was caused by
an approximate representation
x86-64 is
an instruction set architecture(ISA)
which of the following statements is true regarding the hardware implementation of integer arithmetic 1. arithmetic in both unsigned and twos complement representation can be implemented using the same hardware 2. significantly different hardware is required to perform addition in unsigned representation and twos complement representation 3. hardware designed for arithmetic in unsigned representation can be used in twos complement representation but not vice versa
arithmetic inn both unsigned and twos complement representation can be implemented using the same hardware
what is a "C String"
array of ASCII characters terminated by \0
which of the following is not true about character encodings 1. java strings use unicode, which uses 32 bits per character 2. ascii contains encodings for all english, french, and spanish aphabetic characters 3. ascii character values have the same single-byte encoding in utf-8 4. the unicode standard contains thousands of different characters
ascii contains encodings for all english, french, and spanish alphabetic characters
which stage of compilation produces object files as output
assembling
one common way to avoid bugs involving signed and unsigned conversions is to
avoid unsigned integers entirely
which of the following is not stored explicitly in the IEEE 754 format? 1.sign 2.exponent 3. base 4. significand
base
command and response textual interaction linux program
bash
why would a conditional move be preferred over a move guarded by a conditional jump
better performance because of fewer branch predictions
b intel x86 postfix
byte(8 bit)
CF
carry flag
change working directory linux command
cd
given the declaration char **argv, what is the type of argv[0][0]
char
the concept of a file provides an abstraction for which of the following elements? check all that apply 1. displays 2. register 3. process 4. disk 5. keyboards
displays, disk, keyboards
l intel x86 postfix
double word(32 bit)
consider the following line of code double *d = (double*)malloc(sizeof(double)); what is the type of d?
double*
consider the following line of code(assume it is in main()): double *d = (double*)malloc(sizeof(double)); what is the type of d?
double*
Consider the following line of code (assume it is in main()): double *d = (double*)malloc(sizeof(double)); What is the type of &d?
double**
consider the following line of code(assume it is in main()): double *d = (double*)malloc(sizeof(double)); what is the type of &d
double**
if e is the unsigned exponent bits, the exponent value of a normalized IEEE 754 number is
e - Bias
which of the following is true about assembly code? 1. every indented line corresponds to a single machine code instruction 2. it is compiled to machine code by a disassembler 3. it contains a copy of the original c source code 4. lines beginning with a d (.) are comments
every indented line corresponds to a single machine code instruction
read a line of characters into a buffer from a FILE* pointer
fgets
return a FILE* pointer to a newly opened file
fopen
which component of the compilation process combines object files into one executable object program
linker
llist files in current working directory linux command
ls
computers directly execute
machine code
which C function serves the same purpose as the Java "new" keyword
malloc()
which c function serves the same purpose as the Java new keyword
malloc()
which of the following C operators have higher precedence than the dereference (*) operator? select all that apply 1. member/dot (.) 2. equality (==) 3. unary increment (++) 4. binary addition (+)
member/dot unary increment
create a new directory linux command
mkdir
Which of the following instructions would copy 32 bits from %esp into %ebp?
movl %esp, %ebp
a vector register holds
multiple integer or floating point values
edit text files linux program
nano, vim
what is the result in base 10 of the subtraction of 0x80 - 0x08 if using eight bit twos complement representation
negative overflow
what is the meaning of the following: 1001
not enough information to determine
pointer to string parameter(for some flags) - command line processing component
optarg
index of next flag in argv - command line processing component
optind
list of valid flags - command line processing component
optstring
what occurs if the full integer result of an arithmetic calculation cannot fit within the word size limits of the data type
overflow
OF
overflow flag
what is the hex result of ~(0xa7 \ ox3c)
ox40
the use of concurrency to make a system run faster
parallelism
added 4 vector registers
pentium mmx
suppose a C program called"ping" is built from two source files "main.c" and "util.c". Which of the following Makefiles will correctly build the program (and/or re-build it later if either of the two source files are modified)?
ping: main.c util.c gcc -o ping main.c util.c
given the following declaration, how would you access the 'name' field of the 'portscan' variable? typedef struct { char name[16]; long launch_count; } app_t; app_t *portscan = (appt*)malloc(sizeof(appt));
portscan->name (*portscan).name
what is the result in base 10 of the addition of 0100 1101 and 0110 0011 if using 8bit twos complement representation
positive overflow
which stage of compilation works with statements like #include <stdio.h>>
preprocessing
write a formatted string to standard output
printf
consider a pointer, ptr, initialized to NULL. which of the following lines will NOT produce a segmentation fault
printf("%d\n", ptr);
print working directory linux command
pwd
q intel x86 postfix
quad word 64 bit
what cpu component consists of word-size storage units that have unique names
register file
the process of understanding how a system works by observing its behavior and working backward is called
reverse engineering
remove a file linux command
rm
consider an 8bit floating point representation based on the IEEE floating-point format, with one sign bit, three exponent bits, and 4 fraction bits. the exponent bias is 3. for the decimal value 2.5 give the bits for each of the following: s____ e____ f_____
s = 0 e = 100 f = 0100
Which x86-64 instruction would perform the equivalent of x >>= 2 in C, assuming "x" is a signed integer currently stored in register %rax?
sar $2, %rax
Which of the following instructions is equivalent to "setle %al"?
setng %al
Which of the following is equivalent to the x86-64 instruction "sal $4, %rcx"?
shl $4, %rcx
when converting a 32 bit signed twos complement integer to a 64 bit signed twos complement integer, which operation will preserve the correct value
sign extension
SF
sign flag
which is true 1. the c standard requires the use of twos complement integers 2. twos complement encodings include a representation of positive infinity 3. c does not provide support for unsigned integers 4. sign-magnitude integer encodings have two version of the value zero
sign magnitude integer encodings have two versions of the value zero
which number representations have multiple representations for zero
single precision floating point, double precision floating point, signed magnitude, ones complement
which of the following is a correct and safe alternative to the following code? #define MAX_SIZE 256 char target[MAX_SIZE]; strcpy(target, source); //unsafe
snprintf(target, MAX_SIZE, "%s", source);
error in code that produces incorrect/undesired behavior
software defect
remote commannd-line interaction with another computer
ssh
variables that are local to a function are stored in what part of memory
stack
variables that are local to a function are stored in what part of memory>
stack
what parts of the virtual address space do not change in size as the program executed>
static code, static data
Assume the %rbx register stores the value 5, and the %rax register stores the value 3. Which x86-64 instruction would subtract 5 - 3, leaving the result 2 in %rbx
subq %rax, %rbx
when using 8bit word size in twos complement addititon, megative overflow occurs when
x + y < -128
when using 8 bit word size in twos complement addition, positive overflow occurs when
x + y >= 128
which of the following instructions is equivalent to x * 16 if x is represented in 8 bit 2s complement
x << 4
which of the following expressions is equivalent to x * 32 if x is representated in 8 but 2s complement
x << 5
when converting a 32 bit unsingned integer to a 64 bit unsigned integer, which operation will preserve the correct value
zero extension
ZF
zero flag
character printf conversion
%c
decimal number printf conversion
%d
In x86-64, assume the %rax register stores the address of the data you want to access. Which of the following operand specifiers could NOT be used to access the data?
%rax
in x86-64 assume the %rax register stores the data you want to access. which of the following operand specifiers should be used to access the data
%rax
In x86-64, which register indicates the address in memory of the next instruction to be executed?
%rip
The target of most jump instructions is encoded relative to which register?
%rip
in x86-64 which register indicates the address in memory of the top of the system stack
%rsp
null terminated string printf conversion
%s
unsigned hexadecimal printf conversion
%x
which cc operator is used to dereference a pointer?
*
what is the result of evaluating the following expression? true ? 2 - 3 : 5 * 2
-1
if the value -1.89 is rounded to the nearest tenths place using the IEEE round towards zero mode, what will the resulting number be
-1.8
in 4bit twos complement representation, what is the contribution/weight of the most significant bit
-8
if 'data' is an array of 'float' values (4 byytes each), what is the offset (in bytes) of data[0] from the beginning of the array
0
in 4-bit twos complement representation, what is the binary encoding of the number 5
0101
What is the value of %rax after running the instruction "movl $-1, %eax"?
0x00000000FFFFFFFF
assume that x is an int that has the value 5, and the address of x is 0x0804a254. if the machine is a big endian architecture, what is stored at address 0x0804a257
0x05
assume that x is a 32 bit int that has the value 9, and tthe address of x is 0x0904b254. if the machine is a big endian architecture, what is stored at address 0x0904b257
0x09
Assume that %rax stores the memory address 0x1000. The data at what address would be accessed with the operand specifier 2(%rax)?
0x1002
let x be an 8bit unsigned variable storing 0xb2. what is the result of calculating (x << 3) >> 2
0x24
what is the hex result of -x26 & 0xA5
0x24
hex result of 0xae & 0xcb
0x8a
what is the hex result of (0xa7 | 0x3c)
0xbf
assume that x is an int that has the value 0xab78f29e and the address of x is 0x08049000. if the machine is a little endian architecture, what is stored at address 0x08049001
0xf2
give an example of a decimal integer greater than zero that would have the same representation in decimal, binary, and hexadecimal
1
if e is the unsigned exponent bits, the exponent value of a denormalized IEEE 754 number is
1 - Bias
consider the following two structs and the declaration as defined in the reading. struct point { int x; int y; }; struct rect { struct point p1; struct point p2; }; struct rect, r, *rp,= &r; which of the following are equivalent to r.p1.x? select all that apply 1. (rp->p1).x 2. rp -> p1.x 3. r.(p1.x) 4. rp->(p1.x) 5. (r.p1).x
1,2,5
Hello World program in C ANSWER 1 ANSWER 2 { ANSWER 3; }
1. #include <stdio.h> 2. main() 3. printf("Hello, world!\n")
which of the following declarations/initializations are safe in C? 1. int b[4] = {1,2,3,4}; 2. char e[6] = "hello" 3. int *c = {1,2,3,4} 4. int a[] = {1,2,3,4} 5. char d[] = "hello" 6. char *f = "hello"
1. int b[4] = {1,2,3,4}; 2. char e[6] = "hello" 4. int a[] = {1,2,3,4} 5. char d[] = "hello" 6. char *f = "hello"
in which memory regions can C strings be allocated and stored? check all that apply 1. stack 2. static code 3. static data 4. heap
1. stack 3. static data 4. heap
which of the following statements are true in C? check all that apply 1. the calloc() function is an alternative to malloc() that performs initialization as well as allocation 2. calling malloc() always returns a pointer to heap memory 3. is malloc() succeeds, it will set all allocated bytes to zero during allocation 4. the memset() function can be used to "zero out" many bytes in memory
1. the calloc() function is an alternative to malloc() that performs initialization as well as allocation 4. the memset() function can be used to "zero out" many bytes in memory
which of the following is NOT a reason to understand how compilation works? 1. you can quickly debug run-time exceptions 2. you can avoid buffer overflows and other security vulnerabilities 3.you can resolve link-time errors 4. you can optimize your prorams performance
1. you can quickly debug run-time exceptions
if the value 1.37 is rounded to the tenth's place using the IEEE round-to-even mode, what will the resulting number be
1.4
what is the decimal equivalent of the binary value 1.101
1.625
in 4 bit twos complement representation, what is the binary encoding of the number -7
1001
what is the big-endian binary expansion of the hexadecimal value 0xA70C
1010 0111 0000 1100
in 4-bit twos complement representation, what is the binary encoding of the number -5
1011
in 4-bit sign magnitude representation, what is the binary encoding of the number -5`
1101
what is the binary expansion of the hexadecimal value 0xe04d
1110 0000 0100 1101
what is the 8bit 2s complement representation of the negation of 0001 0001
1110 1111
consider the following code struct color { int red; int blue; int green; }; assume that the 'int' type must be at least four bytes. what is the minimum amount of space required to store a 'struct color' variable? specify your answer as an exact numerical byte count
12
if 'data' is an array of 'float' values (4 bytes each), what is the offset (in bytes) of data[3] from the beginning of the array?
12
what is the output of the following C program? #include <stdio.h> main() { int a = 3; int b = 5; int c = 2; printf("%d\n", a + b * c - 1); }
12
what is the value of x << 2 if x is equal to 3 in 8-bit unsigned binary
12
what is the value of x after execution of the following code assuming x and y are 8 bit unsigned integer values and x originally equals 4 y = x; x = x << 1; x = x + y;
12
what is the result in base 10 of addition of 0101 1011 and 0010 0100 if using 8bit unsigned binary representation
127
what is the result in base 10 of the addition of 0101 1011 and 0010 0100 if using 8bit twos complement representation
127
consider the following code: typedef struct { char avatar; int id; double health; } entity_t; Assume that the int type must be at least four bytes, the double type must be at least 8 bytes, and a char is a single byte. assume further that four-byte alignment is required on a particular architecture. what is the minimum amount of space required to store an entity_t variable on that archetecture? specify your answer as an exact numerical byte count
16
the x86-64 integer register file contains how much storage
16 locations for 64 bit values
what is the result in base 10 of addition of 0100 1101 and 0110 0011 if using 8bit unsigned binary representation
176
what is the output of the following code? assume that the address of the variable x is 8 and the address of the variable y is 6. int x = 5; int *y = &x; *y = 1; printf(%d", x + *y);
2
decimal value that has the same encoding in 4 bit unsigned, ones complement, and twos complement
2, 0, 7, 1, 3, 6, 4, 5
consider the following c declarations. Which of the following C expressions are true? float f[10]; float *fp = f; 1. &fp == &f[0] 2. &f == &f[0] 3. fp = &f 4. &fp == &fp[0]
2. &f == &f[0] 3. fp = &f
consider the following declaration: int nums[4] = { 7, 3, 9, 1 }; which of the following array accesses are equivalent to "nums[1]"? Select all that are equivalent 1. nums + 1 2. nums[0 + 1] 3. *(&nums[0] + 1) 4. nums[0] + 1 5. *(nums[0] + 1) 6. *(nums + 1)
2. nums[0 + 1] 3. *(&nums[0] + 1) 6. *(nums + 1)
using a 16 bit floating point representation with 1 sign bit, 6 exponent bits with a bias of 31, and 9 fractional bits, what is the decimal value of 0x4080
2.5
what is the decimal value of the c expression "1 << 8"
256
when using 8 bit word size in unsigned binary addition of number x and y, overflow occurs when
256 <= x + y < 512
which of the following boolean algebra statements is NOT true 1. x ^ y = y ^ x 2. x ^ y ^ x = y 3. x ^ 0 = 0 4. x ^ x = 0
3. x ^ 0 = 0
what is the decimal equivalent of the binary value 11.01
3.25
consider the following code : typedef struct { int id; int sector; double coord[3]; } ship_t; Assume that the int type must be at least four bytes and the double type must be at least eight bytes. what is the minimum amount of space reuqired to store a ship_t variable? specify your answer as an exact numerical byte count
32
what is the maximum value representable by a signed 16-bit integer
32,767
consider the following C code: #include <stdio.h> main() { enum color { BLACK = 1, WHITE, RED, GREAN, BLUE }; enum color background = GREEN; printf("%d", background); } what is the numeric value of background at the end of the code
4
what is the output of the following C program? #include <stdio.h> main() { int a = 3; int b = 9; printf("%d-%d", ++a, b++); }
4-9
what is the decimal equivalent of 0x2A
42
0x2e in decimal
46
what is the limit of the virtual address space size for a processor with a 32 bit word size
4GB
what is the max size of RAM that can be used by a 32 bit machine
4gb
what is the value of x >> 2 if x is equal to 24 in 8 bit unsigned binary
6
consider the following coe: typedef union { int integer; double fractional; } number_t; assume that the int type must be at least four bytes and the double type must be at least 8 bytes. what is the mimimum amount of space required to store a number_t variable? specify your answer as an exact numerical byte count
8
what will the value in %rax be after the following x86-64 code executes movq %5, %rax movq $8, %rbx cmp %rax, %rbx cmovne %rbx, %rax
8
consider the following code: typedef struct { int id; char user_name[16]; } user_t; user_t student [4]; assume that the int type must be at lease four bytes and the char type must be at least a single byte, what is the minimum amount of space required to store the 'student' variable? specify your answer as an exact numerical byte count
80
floating-point co processor
8086
what was the model number of the first standardized floating-point chip
8087
If the register %rdx contains the value y, what value will be in %rax after executing the instruction leaq 4(%rdx, %rdx, 7), %rax?
8y + 4
how many bytes of memory are needed to store the string "Hey Jude"?
9
which operator is opften used from the command line to redirect standard output to a file
> (right angle)
what format for x86-64 assembly code is used by our textbook(as well as gcc and objdump)
ATT
the observation that when one part oof a system is sped up, the effect on the overall system performace depends on both how significant this part was and how much it sped up is called:
Amdahl's Law
which technique allows data to travel directly between disks and memory without passing through the CPU?
DMA
if an IEEE 754 floating-point number has the hex representation 0xFFFFFFFF, what kind of number is represented
NaN
if an IEEE 754 floating-point number has the hex representation of 0xfff0000, what kind of number is represented
NaN
question mark escape sequence
\?
Backslash escape sequence
\\
alert(bell) character escape sequence
\a
backspace escape sequence
\b
horizontal tab escape sequence
\t
vertical tab escape sequence
\v
multiplication by an arbitraty constant can be accomplished by using
a combination of shifting, adding, and subtracting
in C, the 'sizeof' feature is implemented as
a compile time unary operator
when the operating system decides to change which process is running by saving the state of the currrent process, restoring the state of another process, and transferring control to the other process it is called
a context switch
what is a void* pointer in C
a generic pointer
given the decaration char **argv, what is the type of argv[0]
char*
given the declaration char **argv, what is the type of &argv[0]
char**
C basic data types
char, double, float, int
what is the difference between sub instructions and cmp instructions
cmp does not change the desitnation register
which stages of compilation will occur by executing "gcc -c code.c" 1. compiling 2. linking 3. preprocessing 4. assembling
compiling, preprocessing, assembling
the term used to describe the general concept of a system with multiple, simultaneous activities
concurrency
what distinguishes the meaning of bits used to represent data objects
context
multiple individual cpu cores
core 2
added 256 bit vector registers
core i7 Sandy Bridge
copy a file linux command
cp
program that allows you to examine/manipulate another program while it is running
debugger
if the exponent field of an IEEE 754 floating point number is all zeros but the significand has at least one non-zero bit, what kind of number is represented
denormalized
what does *p.q mean in C
dereference field q of variable p
reading a value using a variable that stores the address of the desired value requires what operation
dereferencing
all of the following instructions affect the condition codes except: 1.leaq 2. dec 3. sub 4. sal 5. add
leaq
compile a c program linux program
gcc
which of the following commans will compile test.c into myprog, forcing the compiler to use the c99 standard
gcc -std=c99 -o myprog test.c
read a single character from standard output
getchar
function that should be called repeatedly to return each flag - command line processing component
getopt
there are often multiple "threads" or execution units running in the context of a single process. What kind of data do they share? check all that apply 1.stack 2.register files 3. head 4. global data 5. code
global data, code
visual interface for command-line interaction linux program
gnome-terminal
expanded x86 to 32 bits
i386
which of the following utilities can be used to access the "stu" server via a command line for this course? check all that apply 1. file explorer on windows 2. iTerm2 on macOS 3. gnome-terminal on Ubuntu 4. PowerShell on Windows
iTerm on macOS. gnome-terminal on Ubuntu, PowerShell on Windows
which of the following control-flow constructs from Java does C also provide? check all that apply 1.if 2. while 3. for 4. break
if, while, for, break
ISSUES THAT CAUSE INNACURATE computations with floating point representations
inability to represent some real numbers exactly, rounding error during operations, cancellation of digits during subtraction, lack of associativity for addition and multiplication
if an IEEE 754 floating-point number has the hex representation 0x7f800000, what kind of number is represented
infinity
which of the following provides an abstraction of the actual processor hardware 1.instruction set architechture 2. application binary interface 3. application program interface 4. virtual memory
instruction set arcitechture
what is the best way to declare and allocate an array of five integers on the heap in C
int *nums = (int)malloc(sizeof(int)*5);
view text files one screen at a time without editing them linux program
less
which of the following demonstrates the correct use of a function prototype for the "square" function
int square(int); int main() { return square(16); } int square(int x) { return x*x; }
consider the following C program, and assume that we wish to pass "a" to "cube" as formal parameter "x" with truncation of any fractional part. What should ANSWER be replaced by? int cube (int x) { return x * x * x; } int main() { float a = 5.28; return cube(ANSWER); }
int(a)
round to even is the preferred rounding mode because
it avoids statistical bias
why is the 'strcpy' function considered unsafe
it performs no bounds checks
what does it mean that C is considered a relatively low level language
it provides access to close-to-the-hardware concepts
what does it mean that C is considered a relatively "low level" language
it provides access to close-to-the-hardware concepts (e.g., characters and addresses).
If you wanted to make a jump if (z > 0), which conditional jump instruction would be most appropriate? (Assume z is unsigned.)
ja
If you wanted to make a jump if (y <= 0), which conditional jump instruction would be most appropriate? (Assume y is signed.)
jle
which of the following x86-64 instructions does NOT modify the stack pointer 1. pushq 2. jmp 3. popq 4. call
jmp
what data structure can be used to make x86-64 translations of c switch statements more efficient
jump table
what kind of loop transition was used to generate the following x86-64 code jmp .L2 .L1: addq $2, %rbx .L2: cmpq %rsi, %rbx j1 .L1
jump to middle
applications are forbidden from reading from and writing to what part of virtual memory
kernel
the part of the operating system that is always present in memory
kernel
the transition from one process to another is managed by what piece of system software
kernel
which of the following is not a component of a standard for loop 1. label 2. body 3. update 4. initialization 5. test
label
extract a compressed file linux program
tar
technique that involves writing test code before real code
test-driven development
the output files of the pre-processor and compiler are both stored as ___ files, but the output files of the assembler and the linker are both stored as ____ files
text, binary
which of the following statements is true about the following code? int *x = 0; printf("x = %d", *x)
the code will produce a segmentation fault
what would happen if you try to compile and run the following code in a C function char str[] = "Hey Jude"; str[3] = '\0'; printf("%s", &str[0]);
the code would compile and produce the output "Hey"
what would happen if you try to compile and run the following code in a c function? char str[] = "Hey Jude"; printf("%s", &str[4])
the code would compile and produce the output "Jude"
what would happen if you try to compile and run the following code in a c function? char str[] = "Hey Jude"; str[3] = "\0"; printf("%s", &str[0]);
the code would compile and produce the output Hey
what would happen if you try to compile and run the following code in a c function? char str[] = "Hey Jude"; printf("%s", str[0])
the code would compile, but there would be a segmentation fault
what determines the length of an int in C
the compiler, based on the hardware it is being run on
when converting a 32 bit unsigned int to a 32 bit signed twos complement integer, wich operation will preserve the correct value?
the correct value will always be preserved
when converting a 64 bit unsigned integer to a 32 bit unsigned integer, which operation will preserve the correct value
the correct value will always be preserved
which of the following is true about compiling a c program with the -m64 flag? 1. the executable will be prevented from running on 64-bit architectures 2. the executable can only run on 64-bit architectures 3. it will result in a compilation error because "-m64" is not a valid flag 4. the executable can run on either 32 or 64 bit architectures
the executable can only run on 64-bit architectures
moores law predicted that ___ will double every year
the number of transistors per chip
which of the following is true of x86-64 instructions 1. all instructions are the same length but have different formats 2. disassembling code requires access to the source code version of the file 3. the processor must examine all bytes of an instruction to distinguish the type of instruction it is 4. the objdump disassembler uses a different naming convention than the gcc assembler
the objdump disassembler uses a different naming convention than the gcc assembler
assume that a pointer, ptr, has a value 1024. what would you get by acessinf *ptr[0]
the value stored at the address 1024
what is the hex value of the C expression "0b1000 >> 2"? assume integers are 4-bit.
there is not enough information to tell
what will the following c code do? printf("%s", NULL);
there is not enough information to tell(it could produce a segfault, print null, erase the entire hard drive, or print 0)
which of the following is not true of IEEE 754 floating-point numbers
they are equally spaced on the number line
consider the four bit value 1101. check all that apply 1. this value representts -13 in unsigned binar 2. this value represents -2 in 2s complement representation 3. this value represents 13 in unsigned binary 4. this value represents 2 in 2s complement representation 5. this value represents 3 in 2s complement representation 6. this value represents -3 in 2s complement representation
this value represents 13 in unsigned binary, this value represents -3 in 2s complement representation
what is the result of evaluating the following expression? true == 5 <= 10
true
what is the result of evaluating the following expression? true || var1 < 10
true
given the following declaration, how would you access the 'id' field of the usb variable? struct port usb;
usb.id
what is the best way to pass a large struct as a parameter to a function
use a pointer to the struct rather than the struct itself
what is the best way to determine the number of bytes to read into a struct from a file using fread?
use the sizeof operator with the typedef name of the struct
which of the following parts of the virtual address space change in size as the program executes? check all that apply 1. user stack 2. run time heap 3. read/write data 4. read only code and data 5. kernel virtual memory
user stack, run time heap
the absstraction that provides each process with the illusion that is has the exculsive use of the main memory
virtual memory
what best describes a memory leak
when variables allocated in a function and stored in the heap are lost when the function returns
w intel x86 postfix
word(16 bit)
which of the following boolean algebra statements is true 1. x | (y&z) = (x&y) | (X&z) 2. x & y = ~x | ~y 3. x & (y | z) = (x&y) | (x&z) 4. x|y|z = x & (y |z)
x & (y | z) = (x&y) | (x&z)