If I have a function which only exists for a short amount of time, does making the list of colors a constant make a difference?
string getrandcolor(){
const string colors[5] = {"red", "blue", "green", "yellow", "purple"};
return colors[rand() % 5];
}
Note: The actual list of colors contains hundreds of colors not just the small sample I have shown, not sure if this makes a difference either.