![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
Hi, if i want to initialize a static variable in a function, i could write void test() { static int8 number = 0x88; printf("number: %2X", number++); } But if i want to initialize a static structure in a function, what should i do? typedef struct _NUM { BYTE a; BYTE b; } NUM; | |
| |
| | #2 |
| Code: typedef struct _NUM {
BYTE a;
BYTE b;
} NUM;
//initilization
struct _NUM MyNumStruct = { 10, 20 };
| |
| |
|
| Tags |
| ccs, initialize, static, structure |
| Thread Tools | |
| Display Modes | |
| |