Too late to edit but I wrote pointer to char[M] as char[M]* when, of course(!), it should be written as char(*)[M].