Greetings.
Are statically allocated two-dimensional arrays guaranteed to be
contiguous, or is it possible the compiler will allocate padding after
each row? Is the following code OK?
#include <string.h>
int main(void) {
char a[5][5];
memset(a, 'x', 25);
return 0;
}
Regards,
Tristan
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= < In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Are statically allocated two-dimensional arrays guaranteed to be
contiguous, or is it possible the compiler will allocate padding after
each row? Is the following code OK?
#include <string.h>
int main(void) {
char a[5][5];
memset(a, 'x', 25);
return 0;
}
Regards,
Tristan
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= < In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Comment