Shilpa Shilpa - 1 year ago 74
C Question

How to declare a memory of size n x n in c.

I am working on compiler design for 8051. I want to declare a memory of say 30 locations, each location is of 8bits. How do I declare that in C?

Answer Source

to declare 30 x 8 bits memory:

char memory[30];

to declare n x n memory:

char memory[30][30];

it declares 30 x 30 x 8bits memory.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download