I need to do something like this:
sizeof(int[width][height][8])
but unfortunately in c89 (the standard i have to use) this notation is forbidden, is there any way to do the same thing but using pointer notation?
It works fine in c99 but not in c89
You can write this instead:
Make sure you put the
sizeof(int)first to forcewidthandheightto be converted tosize_tand avoid a potential integer overflow onwidth * height * 8ifwidthandheighthaveinttype.