Joined
Last Seen
0 Reputation Points
0 Endorsements
Ranked #44.2K
computeCube function is correct, but the main function has a problem. Explain why it doesn't work and show how to fix it. Your fix must be to the main function only; you must not change computeCube. [CODE] void computeCube(int n, int* ncubed) { *ncubed = n * n * n; … |
|
[CODE]void findMax(int arr[], int n, int* pToMax) { if (n <= 0) return; // no items, no maximum! int max = arr[0]; pToMax = &arr[0]; for (int i = 1; i < n; i++) { if (arr[i] > max) { max = arr[i]; pToMax = (arr+i); } } } int … |