click below
click below
Normal Size Small Size show me how
EPSII
TEST 2
| Question | Answer |
|---|---|
| ARRAYS | ARRAYS |
| What do array subgroups have in common? | Same name and type |
| To refer to an element of an array, what must you specificy? | The name and position number |
| How do you declare the array whose location is in position 11? | int c[12]; |
| Array subscripts start counting at? | c[0]-->c[n-1] |
| Say, i declared the number of elemtns to be 5, but I called the sixth element, what happens? | You'd call a zero |
| Give me an example of when you'd get an error when you compile an array? | int n[ ]= {1,2,3,4}; |
| To pass an array argument to a function, what must you specify? | The name of the array without brackets |
| Give me an example: | myFunction (myArray, 24); |
| What is it called to pass arrays? | Pass by REFERENCE |
| What | (blank) |
| POINTERS | POINTERS |
| How are address locations stored? (Binary, hex)? | Hex |
| What does isalpha take? | Character, not a string |
| What does strcmp return if the strings are identical? 0 or 1? | 0 |
| When you're passing a variable to a function, what symbol do you use? | The & |
| As part of the terminator trick, where do you want to end the for loop sweep/ | -1 |
| What is the max amount of values a funtion with a pointer can return? one without? | more than 1; one |
| Do you specify bounds (i.e. b[ THIS ]) in a function prototype and header? | Nope |
| What is the only thing you need to specify in a function prototype? | Only the type |
| Essentially, what are the components of the bubble sort and what does each do? | For (passes) inner for (comparisons per pass), and if (exchange values) |
| Does greater than or less than give you sorting in increasing order? | greater than |
| What symbol is not used to pass arrays and why? | Not the & b/c array name is a pointer |
| What is ( *studPtr ).suit equal to? | studPtr->suit |
| What does this do: %08d ? | Eight fields wide, with zeros at the front |
| what does isalnum do/ | return true if c is a digit or a character |
| What does double atof(*nptr) | Converts string nptr to double |
| What does *strcpy (char *s1,const char *s2) do? | copies s2 into array 1, returing s1 value |
| In a string compare, if the right is bigger, what is the return? | Negative |
| Do pointers and strings go together? | No |
| What can't structs contain? | functions |
| int strcmp(char *s1, char *s2); | (blank) |
| When do you get a negative value? | If right is bigger |
| Positive value? | if left is bigger |