samedi 18 avril 2015

Assigning array of strings to char **

In C, I know you can assign strings to char pointers, so by extension, why does this fail?



char **notes;

notes = {
"C3", "C4", "A2", "A3", "A2#", "A3#", "REST",
"C3", "C4", "A2", "A3", "A2#", "A3#", "REST",
"F2", "F3", "D2", "D3", "D2#", "D3#", "REST",
"F2", "F3", "D2", "D3", "D2#", "D3#", "REST",
"D3#", "D3", "C3#", "C3", "D3#", "D3", "G2#",
"G2", "C3#", "C3", "F3#", "F3", "E3", "A3#",
"A3", "G3#", "D3#", "B2", "A2#", "A2", "G2#"
};


I get the error:



error: expected expression
notes = {
^


(Bonus points to anyone who can identify the song. Hint: switch the sharps to equivalent flats)


Aucun commentaire:

Enregistrer un commentaire