declare and write array

I want to develop array w3 with dimensions 4*1(height*width) as below and write
a_1...._a4 in it. How could i write w3 with these? Pleae tell me the syntax.
1
2
3
4
5
6
7
unsigned int w3 [4][1];
    
    unsigned int a_1  = 0x02;
    unsigned int a_2  = 0xff;
    unsigned int a_3  = 0x32;
    unsigned int a_4  = 0x0f; 


Well, if the width is 1, the array has just a single dimension - unless you plan to change the design later, the [1] isn't needed.
 
    unsigned int w3[4] = { 0x02, 0xff, 0x32, 0x0f };
Last edited on
Actually I want array of 4 rows and 1 column.

Is array of 4 rows and 1 column the same as 4*1(height*width)?
4*1 equals 4. 4 elements. A 1D array for 4 elements, like Chervil suggested.

There is no "right" in space.
Topic archived. No new replies allowed.