Array with characters << SOLVED>>

I would like to know how to setup an array with characters ie

const uint8_t servoDirection[]={'|','\','/'};

this is incorrect - can someone show me the correct method.

Try to escape the \

const uint8_t servoDirection[] = {'|', '\\', '/'};

See Escape sequences - cppreference.com for Character literal - cppreference.com

1 Like

Thanks - for the correction and the reading information - it worked.

Glad it helped.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.