Random name generator from a pool

I have a list and, it has got same names ,so code should give me name and number at the same time also shouldnt repeat same number

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 #include <iostream>
#include <cstdlib>
#include <string>
using namespace std; 


	
		char isimler[250][30];

strcpy( isimler[1],"Abdullah ");
strcpy( isimler[2],"Abdussamed ");
strcpy( isimler[3],"Adem ");
strcpy( isimler[4],"Ahmet");
strcpy( isimler[5],"Akif ");
strcpy( isimler[6],"Alev ");
strcpy( isimler[7],"Ali");
strcpy( isimler[8],"Ali osman ");
strcpy( isimler[9],"Ali utku ");
strcpy( isimler[10],"Alp ");
strcpy( isimler[11],"Alper ");
strcpy( isimler[12],"Arzu ");
strcpy( isimler[13],"Asan");
strcpy( isimler[14],"AslIhan ");
strcpy( isimler[15],"Atakan ");
strcpy( isimler[16],"Ayhan ");
strcpy( isimler[17],"Aykut ");
strcpy( isimler[18],"Aysel ");
strcpy( isimler[19],"BarIs ");
}
I see the list with the names, but where is the code?
Do you understand about random in C++?

The link below may help you on how to ask a problem:

http://www.cplusplus.com/forum/articles/40071/#msg218019

Write the code, then be specific about the problem you are having.

Good luck.

closed account (48T7M4Gy)
??
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

using namespace std;

int main()
{
	const int limit = 19;
	
	char* isimler[ limit ] = { "Abdullah", "Abdussamed", "Adem", "Ahmet",
		"Akif", "Alev", "Ali", "Ali osman", "Ali utku",
		"Alp", "Alper", "Arzu", "Asan", "AslIhan",
		"Atakan", "Ayhan", "Aykut", "Aysel", "BarIs" };


	for (int i = 0; i < limit; i++)
		cout << i << '\t' << isimler[i] << endl;

	return 0;
}
ok thanks the list is above 200 users and i need to select random one by one
closed account (48T7M4Gy)
So what's the question? All the above does is get the names into a list/array and shows a simple way to paly around with them by displaying them.

You can select one at random by writing a couple of lines to generate an integer, say xyz, between 0 and 19 and then
cout << isimler[xyz] ;


If you search on this site you'll find details and simple tutorial on random numbers and how you can generate them.

20, 200 or 20,000 names, it's pretty much all the same.

Topic archived. No new replies allowed.