File I/O
Bitwise
ADT
Structs/ unions
Translation
100

Which file open mode will not create a new file if the given one does not exist?

what is r (read)

100

What operation inverts the bits

~ (complement)

100

What is the purpose of an ADT?

To hide the implementation from the user

100

this C keyword defines a new name for a type to be defined

What is typedef

100

The goal of translation is to convert source code into ___

What is an executable load module / machine code

200

What does the function fgetc() do?

What is Gets one character from a file.

200

1011 ^ 1100 = 

what is 0111

200

The _____ for an ADT serves as the interface for the client

What is header file

200

What will changing sh[1] also change for 

union Thing{

char ch[3]

int x;

float y;

short sh[2];

char c;

}

What is ch[2], ch[1], x, y, and c

200

The compiler, consists of 3 analyses: what are they?

what is lexical, syntax, semantic 

300

Which function writes to a file in binary?

what is fwrite()

300

1001 << 2

what is 0100

300

C is a ___-typed language that does ___ typing

what is weakly and static

300

What is the size of the union below?

union u{

     char c[8];

     int i[4];

     void * v[3];

     double d;

     unsigned short s[10];

};

What is 24 (8 * 3)

300

The linker links your code to other c programs as well as external ___

what is libraries 

400
How would u read two integers in a file (include parameters)

What is fread(ptr, sizeof(int), 2, file)

400

char a = 0xf2;

printf("0x%02x\n", (a >> 4) & 0xff);

What is 0xff

400

Scalar types...what are they?

what is decimal numbers + discrete types

(floats, chars, longs, etc...)

400

create a struct with bitfields for a specialized unsigned char such that

- 2 bits specify input

- 1 bit specifies a flag

- 5 bits are used for data

struct bitField{

    unsigned char input : 2;

    unsigned char flag : 1;

    unsigned char data : 5;

};

400

Wild card: first team to draw the proper syntax tree for the following expression wins:

10 - 4 - 3

With the grammar rules

Expression --> term | expression add_op term

term --> factor

factor --> identifier | number | -factor | (expression)

add_op --> + | -

What is, Im not typing up the answer

500

Finish the line below so that it opens the .c file of the current program to read it in binary.

FILE* file = ____

What is FILE* file = fopen(__FILE__, "rb");

500

unsigned char a = 0b10001000;

char b = 0b11110000;

printf("%i\n", ~a & b || 0b00110011);

what is 1

500

Given the definition 

typedef struct coolADT_s* CoolADT;

make the following function:

CoolADT cool_create();

What is:

CoolADT cool_create(){

CoolADT newCool = (CoolADT) malloc (sizeof(struct coolADT_s));

assert(newCool != 0);

return newCool;

}

500

What is the size of the following struct:

This is the size of the following struct:

struct country{

char name[50];

long population;

short data;

float more_data;

};

What is 72 bytes

500

Given the following defines:

What is the result of the following code?

#define ADD4(x)    4+x

#define SQU(y)     y*y

int main( void ){

    int a =  3;

    printf("%d\n", SQU(ADD4(a)));

    return 0;

}

what is 19

M
e
n
u