a. strdup b. strcpy c. strchr d. type cast
e. strcmp f. extern g. struct h. typedef
i. union j. void * k. char * l. #include
m. malloc n. free o. scanf p. printf
q. stdin r. stdout s. stderr t. fscanf
u. fprintf v. sscanf w. sprintf x. hexidecimal
y. octal z. decimal aa. binary bb. compiler
cc. linker dd. object file ee. executable file
ff. argc gg. argv hh. data encapsulation
ii. bus error jj. segmentation violation kk. Jval
For each of the following questions choose the best answer from the above list. You may have to use the same answer for more than one question:
- ____________ A data type that represents a generic type.
- ____________ A function that copies a string from a source to a
destination and which assumes that the source already
has enough memory to accommodate the copied string.
- ____________ What the -o option causes gcc to produce.
- ____________ The result when you try to access a memory address that
is not divisible by 4.
- ____________ A system function that you can use to convert a string
to an integer.
- ____________ Another name for a base-8 number.
- ____________ The variable that represents command line arguments
as an array of strings.
- ____________ The I/O stream you should use when writing error messages
to the user.
- ____________ The keyword used to specify a shorter, more readable
name that can be used for a struct.
- ____________ The name of the operation that converts a (void *) to
a (char *). For example, char *s = (char *)v;
char name[20];
char first_name[10];
char last_name[20];
char *str_ptr = (char *)malloc(sizeof(char) * 5);
void *void_ptr;
IS is = new_inputstruct(0);
Jval j;
char c;
_________ scanf("%s", str_ptr); // assume the string to be read is less than 5 chars
_________ str_ptr = is->fields[3];
_________ j.s = name;
_________ name = (char *)j.v;
_________ str_ptr = strdup(first_name); strcat(tr_ptr, last_name);
_________ str_ptr = (char *) void_ptr;
_________ scanf("%d", j.i);
_________ c = name[3];
3 10 12You should assume that you have the following definition for a list node:
struct node {
struct node *next;
int value;
};
The lists do not have sentinel nodes so the pointers passed to your
function point directly to the first nodes on their respective
lists. The last element of each list will point to null (0). If
you want full credit your solution should take advantage of the fact
that the two lists are sorted and traverse each list only once.
If you cannot figure out how to do that, you can write a program for
26 points that traverses one list once and the other list multiple
times.
void print_common_elements(struct node *L1, struct node *L2) {