array assignment question.

I am not familiar enough with c++ to know if a built in function exists to simplify my code.

This feels inefficient. The leds is 49 elements deep. I know I can assign during declaration but I need to alter these values during run time. To be honest I bet this code is very efficient for speed during execution but not pretty when reading the code and not so easy to modify the range or assignment value.

leds[0] = CRGB::Red;
leds[1] = CRGB::Red;
leds[2] = CRGB::Red;
leds[3] = CRGB::Red;
leds[4] = CRGB::Red;
leds[5] = CRGB::Red;

I know I can make a for loop, but is there a way to assign those continuous elements in mass?

Something like: leds[0-5] = CRGB:Red;

This might also work: fill_solid( leds, 6, CRGB::Red); but would not help me if the elements were [10-15].

Thanks in advance,

Paul

What is the data type for the leds[] array; a long?

kd6lor:
This might also work: fill_solid( leds, 6, CRGB::Red); but would not help me if the elements were [10-15].

Sure it would:

 fill_solid(leds+10, 6, CRGB::Red);

econjack:
What is the data type for the leds[] array; a long?

Looks like a CRGB from FastLED library.

Thanks all for the help, especially you gfalvo, will give that a try tonight and see if I can make it work. I feel like I am learning to walk all over again. I am trying to learn by looking at coding examples and internet how-toos but when I can't find something I don't know if it's because thats not how its done or because I cant find it.

Now that I read the help gfalvo gave me, it makes sense. the expression evaluates and passes on to the routine. But prior to reading that post it didn't register.

Thanks again,

Paul