M
miloody
Dear all:
At the end of letter is my source code.
My questions are:
If I declare a global multi-dimension array, how could I assign it
value fast later in my local function?
I don't want to assign it one by one by for loop, since it seems quite
inefficient.
BR,
miloody
/*
ex1 is assign it at beginning.
ex2 is the wrong way.
*/
#include <stdio.h>
#include <stdlib.h>
int Array[3][8];
/* ex1
int Array[3][8] = {{0x80,0x06,0x00,0x02,0x00,0x00,0x08,0x00},
{0x00,0x05,03,0x00,0x00,0x00,0x00,0x00},
{0x00,0x09,0x01,0x00,0x00,0x00,0x00,0x00}};
*/
int main(void)
{
//ex2
Array[0] = {0x80,0x06,0x00,0x02,0x00,0x00,0x08,0x00};
}
At the end of letter is my source code.
My questions are:
If I declare a global multi-dimension array, how could I assign it
value fast later in my local function?
I don't want to assign it one by one by for loop, since it seems quite
inefficient.
BR,
miloody
/*
ex1 is assign it at beginning.
ex2 is the wrong way.
*/
#include <stdio.h>
#include <stdlib.h>
int Array[3][8];
/* ex1
int Array[3][8] = {{0x80,0x06,0x00,0x02,0x00,0x00,0x08,0x00},
{0x00,0x05,03,0x00,0x00,0x00,0x00,0x00},
{0x00,0x09,0x01,0x00,0x00,0x00,0x00,0x00}};
*/
int main(void)
{
//ex2
Array[0] = {0x80,0x06,0x00,0x02,0x00,0x00,0x08,0x00};
}