Quote (Shakti @ Jul 11 2015 10:07am)
Can someone explain, in simple terms, what the purpose of objects and arrays are? What is a real life example where objects and arrays would be used?
I've been doings objects/arrays all morning. I can do them but I dont understand WHY do them?
Objects - I want a single structure which represents something meaningful to me (more meaningful than say, an integer, which stores a signed/unsigned number)
Arrays - I want to store more than 1 thing inside a single thing where the order is either unnecessary (because maybe we are 'consuming' the things) or the order is known by the developer
so instead of:
Code
Int a, b, c, d , e, f, g, h, i, j, k, l, m , n, o, p, q, r, s, t, u, v, w, x, y, z;
I can just say
Code
myIntArray a[25];
I haven't even talked about queue/stack/BST etc with arrays either.
Or all the crazy shit with objects.
Feel free to look online for enlightenment.
This post was edited by Eep on Jul 11 2015 09:21am