0
What would the practical purpose of this be? If they all are the same why use an array? Why not just use a single integer?
I feel like using a more complex system to do what a simpler system could do just unnecessarily confuses/complicated the matter, No?
7 Respuestas
+ 4
the example may have seemed useless, but arrays are extremely useful. they help save memory and make managing lots of variables easy.
if you have 5000 students you wouldnt give each one its own variable. and if you got a new student youd have to add a variable to the source code when you could just use a GUI interface to push the new student into the existing array of students
+ 2
Zach Schmitt are you referring to this lesson?
https://www.sololearn.com/learn/CPlusPlus/1627/
If so, the lesson just want to show that a value gets assigned to each array index when you loop through it.
+ 1
Perfect! Thanks koala 🐨 ! The example just seemef entirely pointless, but if it can be used to do other things than assign the same variable to [infinite] I fully see the value
0
what is "this" you are referring to?
0
Arrays in C++. Making an array' s index spit out all the same values was the lesson I just did. Seems pointless
0
~ swim ~ I am thinking about it and if they are the same number it's stupid and a waste of time to add it in as a code. If it has the same value use the same integer.
0
So Jonathan Pizarra , am I to assume next lesson it will show the practical application? I guess I should have continued on as I have encountered that before