C++ :: Function To Determine Largest Value In Array And Then Outputs Value And Index
Dec 5, 2013
I'm trying to create a function that determines the largest value in the array and then outputs the value and index. I want to values in the array to be random so I tried using the rand function, although I'm not sure where I'm supposed to put it. My main problem (I think) is outputting the correct values...
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void lastLargestIndex (int numbers[], int arraySize);
int main(int argc, char** argv) {
int number, arraySize = 50;
[Code] ....
View 2 Replies
Jun 9, 2013
This is an assignment question In C++, there is no check to determine whether the array
index is out of bounds.Design a class myArray that solves the out-of-bound array index problem and allows the user to begin the array index starting at any integer, positive or negative. Every object of type myArray should be an array of type int.
Part 1 processes only int arrays. Redesign the class myArray using class templates so that the class can be used in any application that requires arrays to process data.
I don't understand the second part. should i just change the array from int to char or something?
View 1 Replies
View Related
Jan 12, 2015
I'm very new to c programming and I have some background in C# and java. I am supposed to read a string from input then determine in that string, which character is the largest, i.e. I think b>e and e>z, e.t.c. If the string is empty I should return '