vault backup: 2024-10-25 14:06:54
This commit is contained in:
		| @@ -9,7 +9,12 @@ | ||||
| ```c | ||||
| middle = (low + high) / 2 | ||||
| ``` | ||||
| The above statement is illegal because you can't add an `int *` to an `int *`. It can be made legal by casting `low` and `high` to numbers, performing the operation, then casting to a pointer. | ||||
| The above statement is illegal because you can't add an `int *` to an `int *`. The below operation is legal because you can perform pointer subtraction, and because `low` is defined on the left hand side of the equation, then adding a long to a pointer is valid. | ||||
| ```c | ||||
| middle = (int*) (((long) low + (long) high) / 2); | ||||
| middle = low + (high - low) / 2; | ||||
| ``` | ||||
|  | ||||
| 3. What will be the contents of the `a` array after the following statements are executed? | ||||
| ```c | ||||
| {1} | ||||
| ``` | ||||
		Reference in New Issue
	
	Block a user
	 zleyyij
					zleyyij