Quantcast
Channel: Keil Discussion Forum RSS Feed
Viewing all articles
Browse latest Browse all 3049

ARM: and again the question of variables (2 Replies)

$
0
0
There is an SRC variable of 16 bits, how to create two 8-bit variables, so that one is addressed to the upper part and the second to the lower part of the SRC variable? type construction uint16_t src; uint8_t b1 = * ((uint8_t *) & src); uint8_t b2 = * (((uint8_t *) & src) +1); should work but at compilation produces: MAIN.c (16): error: # 28: expression must have a constant value uint8_t b1 = * ((uint8_t *) & src); MAIN.c (17):

Viewing all articles
Browse latest Browse all 3049

Trending Articles