0

arrays

how to program an array when the objects are text i have the variable here but what do you do to draw it randomly.

1st Nov 2019, 3:04 PM
jessie
3 Respuestas
+ 3
jessie Please follow this guide for posting a question https://www.sololearn.com/Discuss/333866/?ref=app
1st Nov 2019, 3:36 PM
Ipang
+ 1
I think you want to say "How to pass objects as an array or arrays of object !!" If yes here you go.... In c++ int main () { int size = 3 BOOK book[size] ; //BOOK is class and book is object for(int i=0;i<size;i++) { book[i].getdata();//getdata() is function inside BOOK class } In java: BOOK obj[] = new BOOK[2] ; //BOOK is class obj[0].setData(1,2); obj[1].setData(3,4); obj[0].showData(); obj[1].showData(); //setdata() and showdata() are function in class BOOK If this is what you want !! All the best :)
1st Nov 2019, 3:54 PM
Chirag Kumar
Chirag Kumar - avatar
0
Can you paste the code.
1st Nov 2019, 3:32 PM
Inkosi
Inkosi - avatar