c++ Project Compile Error about pointer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

c++ Project Compile Error about pointer

Jump to solution
1,805 Views
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 Kudos
Reply
1 Solution
1,791 Views
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;

View solution in original post

0 Kudos
Reply
1 Reply
1,792 Views
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 Kudos
Reply