How to write an embedded C program for adding two numbers stored in memory locations

Thread Starter

usercurious2002

Joined Nov 27, 2022
1
Can use a pointer to access content of the memory location on embedded c.
I need to write a program that add two numbers stored in memory location.
Code:
int *p;
int *q;
p = (int*) 0x30610000;
q = (int*) 0x30610004;
int sum=(*p)+(*q)

Is the above code correct?
I need understand how access a content of memory location on embedded c.
 
Top