Question about using arrays

I’m working through the projects in an Arduino beginner’s kit that I bought. This particular sketch plays a simple melody through a piezo element.

The project is posted here.

It looks like they are setting up two arrays at the very beginning of the program.

char notes is an array of characters and int beats is an array of integers called “beats.”

So far so good?

Every example of arrays that I’ve found uses the format: {array, elements, go, here}

Why are there no { } around the “notes” array? Why is it enclosed in “quotes” instead? Is this what you do with a “char” array? I did look up a few pages online but didn’t readily find an answer.

The part of the code I’m asking about:

int speakerPin = 9;

int length = 15; // the number of notes
char notes[] = "ccggaagffeeddc "; // a space represents a rest
int beats[] = { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4 };
int tempo = 300;

Because they’re characters, “special case.”

Well, you could do it this way:

char notes[] = {67, 67, 71, 71, 65, 65, 71, 70, 70, 69, 69, 68, 68, 67, 32, 0};

or this way:

char notes[] = {'c', 'c', 'g', 'g', 'a', 'a', 'g', 'f', 'f', 'e', 'e', 'd', 'd', 'c', ' ', 0};

They would create exactly the same array. But since char arrays are used so much, the creators of C decided to make an easier way to do literal strings. It's just an easier syntax to create a null terminated character array.

The posted code doesn't actually use the null terminator, so you could save one byte by using one of the other syntaxes and leaving off the 0 at the end.