Using Typedef With Arrays

I have already defined two arrays:
1
2
int songId[15];
char typeOfSong[15]


For my assignment we HAVE to use typedef to declare these. I tried a multitude of combinations using typedef, but then the rest of my code that uses songId and typeOfSong is not valid. How would I set up the correct arrays using typedef?

Thank you!
a typedef declaration has exact same syntax as a variable declaration, except for the word typedef in it:

1
2
char typeOfSong[15]; // defines an object of type "array of 15 char" called "typeOfSong"
typedef char typeOfSong[15]; // defines a type alias of the type "array of 15 char" called "typeOfSong" 


So, you're probably meant to write
1
2
3
4
typedef char typeOfSong[15];
typeOfSong song1;
typeOfSong song2; 
// etc 
Topic archived. No new replies allowed.