c++ Project Compile Error about pointer

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

c++ Project Compile Error about pointer

ソリューションへジャンプ
1,806件の閲覧回数
YS_Kwak
Contributor I

Good day.

I'm trying to solve the compile error regarding pointer, still I couldn't.

See the images.

I just use very simple pointer in order to read MCU register.

YS_Kwak_0-1641340190266.png

But it always shows compile error "invalid conversion from 'uint32_t' {aka ~~~~~~~~"... 

YS_Kwak_1-1641340222233.png

 

Could you please help me to solve this issue?.

Does this compile error come from wrong setting in IDE tool?

 

 

0 件の賞賛
返信
1 解決策
1,792件の閲覧回数
ErichStyger
Specialist I

In C++, you cannot assign an integer to a pointer without proper cast.

You have to write something like this:

pRegAddr = (uint32_t*)0x12345678u;

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,793件の閲覧回数
ErichStyger
Specialist I

In C++, you cannot assign an integer to a pointer without proper cast.

You have to write something like this:

pRegAddr = (uint32_t*)0x12345678u;

0 件の賞賛
返信