vault backup: 2024-11-01 13:28:59
This commit is contained in:
		| @@ -21,9 +21,10 @@ int i; | ||||
| *sum = 0.0; | ||||
| for (i = 0; i < n; i++) | ||||
| 	// This wasn't increasing the value | ||||
| 	// `sum` points to, it was modifying the address the pointer po | ||||
| 	// `sum` points to, it was modifying the address stored in the pointer | ||||
| 	(*sum) += a[i]; | ||||
| avg = sum / n; | ||||
| // Missing dereference operators | ||||
| *avg = *sum / n; | ||||
|  | ||||
| } | ||||
| ``` | ||||
		Reference in New Issue
	
	Block a user
	 zleyyij
					zleyyij