dimanche 4 janvier 2015

Assigning a const-string to a constant sized char array, what happens in un-used array indices?

Let's say I have:



char name[16] = "123456789abc";


so name[11] == 'c', name[12] == '\0'.


Will name[13] be gibberish/compiler-dependant, or will it reliably be a specific value (such as '\0'?)


Aucun commentaire:

Enregistrer un commentaire