The Way to Programming
The Way to Programming
i just wanna know if there’s a way where i can pick out the highest number out of a series of them, so for example, i have like 1, 23, 34, 342, 1, 32,31, 21, 65 etc etc i wanna be able to just pick out the highest number from the above (the numbers are what’s outputted when i compile and run the program), I’m thinking of using an array, but i heard there’s another way i can do it:S its not meant to be a difficult thing, just beginner programming …
you just need to assign the numbers that are being returned into the array.
find out how the numbers that are being returned are decelerated. and the simply input them in the array the same way that is shown above.
so if x = 5 don’t do int Nbrs[] = { 5 }, but do int Nbrs[] = { x }. (crudely speaking)
hope I’m on the right track, cause I’m not sure what you mean.
all those functions you wrote already exist in the stl….learn the stl if you want to call yourself a c++ programmer. No point in reinventing the wheel, and all stl containers and algorithms by standard enforce certain run times (which are generally fast) and can even be faster (ie. sorts in stl are usually O(n logn) complexity, while above example is O(n^2))
Sign in to your account