Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Tactics/cNames.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
17 lines (16 sloc)
626 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <random> | |
#include <vector> | |
#include <time.h> | |
using namespace std; | |
string nameCreation() | |
{ | |
/** array of length 16 created with 16 different names in there **/ | |
string names[16] = {"Jennifer","Lucy","Derrek","Timothy","Atutu","Osama","Barack","Donald","Jeremiah","Giovanni","Maria","Johnschnatter","Tony","Leonardo","Yu","Lheing"}; | |
/** sets the random seed to be based on the current time **/ | |
srand (time(NULL)); | |
/** rndm is equal to a random number between from 0 and 15 **/ | |
int rndm = rand() % 15; | |
/** returns a random name from the array **/ | |
return names[rndm]; | |
} |