lukelukeluke
Technical User
Hi there.
Im working on a little chatclient project.
The idea is that im setting up an array for the users. When someone joins, it calls the function adduser(String user) which adds this user to the user array. There will be a removeuser(String user) function too. But the problem is that when I'm setting up the array:
String users[] = {"peter","chulio","rodriguez"};
it has 3 elements: users[0], users[1], users[2]. But what if I now want to add a user to it? Can i add users[3] in any way? There will may be 200 users in the end, how can i put them in?
Should I just build an array with 1000 empty elements? So I can put in 100 users?
Thanks for your ideas.
Greetings, Lucas
Im working on a little chatclient project.
The idea is that im setting up an array for the users. When someone joins, it calls the function adduser(String user) which adds this user to the user array. There will be a removeuser(String user) function too. But the problem is that when I'm setting up the array:
String users[] = {"peter","chulio","rodriguez"};
it has 3 elements: users[0], users[1], users[2]. But what if I now want to add a user to it? Can i add users[3] in any way? There will may be 200 users in the end, how can i put them in?
Should I just build an array with 1000 empty elements? So I can put in 100 users?
Thanks for your ideas.
Greetings, Lucas