I can take a
stab at this, but without any code I have a good chance of thoroughly slaughtering it.
//--------------------------------------------
/* Decalre these in the header */
/*
The maximum number of names...
You can also just take out this and not put anything inside the brackets. This will allow you an unlimited amount of names.
*/
#define MAXNAMES 100
/* The array */
String userNames[MAXNAMES];
/* your going to need to memset the array, but I'm doing this from memory and i don't want to give you bad code if avoidable */
//--------------------------------------------
/* this is after the user inputs a name. WARNING: this will only input one name */
/* where the name is stored */
String name;
/* loop through the array in order to find a blank space for the name */
for (int i = 0; i <= MAXNAMES; i++)
{
/* find a blank string */
if (userNames
== NULL)
{
/* put in the name */
userNames = name;
return;
}
}
//--------------------------------------------
/* inside the function where you want the name printed */
for (int i = 0; i <= MAXUSERS; i++)
{
/* print the string. I would do this the correct way, (%s, and so on...) but it's been a while since I had to do console programming, and I forgot */
String p = "Name Number " + IntToStr(i) + ": " + userNames;
printf(p);
}
//--------------------------------------------
That's the best I can do from memory without code. I don't have a compiler on the machine I'm writing this from, so I'm doing all of this somewhat blind. If it doesn't work right, or isn't what you want, don't hesitate to ask and I'll see what I can't do. Cyprus
![[noevil] [noevil] [noevil]](/data/assets/smilies/noevil.gif)