2657 views|2 replies

298

Posts

0

Resources
The OP
 

How to write pointer array in stm32 [Copy link]

as follows:

code u8 STB1[][3]={};

code u8 STB2[][3]={};

code u8 code *std[]={STB1,STB2}; This worked in 51 before, but there was a problem when ported to 32 (code has been changed to const). Error message: a value of type "const u8 (*)[3]" cannot be used to initialize an entity of type "const u8 *" . I don't know why? How to change it and why?

This post is from stm32/stm8

Latest reply

const uint8_t STB1[3][3]={{0,0,0}}; const uint8_t STB2[3][3]={{0,0,0}}; const uint8_t * std[]={(uint8_t *)STB1,(uint8_t *)STB2}; Variables defined by const will be compiled into the ROM area, so the array size must be specified [][3] This is not possible.   Details Published on 2019-10-23 15:40
 

4005

Posts

0

Resources
2
 

const uint8_t STB1[3][3]={{0,0,0}};
const uint8_t STB2[3][3]={{0,0,0}};
const uint8_t * std[]={(uint8_t *)STB1,(uint8_t *)STB2};

Variables defined by const will be compiled into the ROM area, so the array size must be specified [][3] This is not possible.

This post is from stm32/stm8

Comments

ena
Yeah, thank you!  Details Published on 2019-10-27 20:50
 
 

298

Posts

0

Resources
3
 
huo_hu Published on 2019-10-23 15:40 const uint8_t STB1[3][3]={{0,0,0}}; const uint8_t STB2[3][3]={{0,0,0}}; const uint8_t * std[ . ..

Yeah, thank you!

This post is from stm32/stm8
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list