How to assign pointer address manually in C programming language?

后端 未结 3 2058
太阳男子
太阳男子 2020-11-30 19:16

How do you assign a pointer address manually (e.g. to memory address 0x28ff44) in the C programming language?

3条回答
  •  南方客
    南方客 (楼主)
    2020-11-30 19:53

    int *p=(int *)0x1234 = 10; //0x1234 is the memory address and value 10 is assigned in that address
    
    
    unsigned int *ptr=(unsigned int *)0x903jf = 20;//0x903j is memory address and value 20 is assigned 
    

    Basically in Embedded platform we are using directly addresses instead of names

提交回复
热议问题