Hi , I am giving a small C program ..this is to find the factorial of a given number. I would like to know how i could write the output value "fact"to a specifed memory location (For example like 0x40003456.
#include <LPC21xx.H> #include <stdio.h> void main (void) { int i,fact=1,value=6; for (i=1; i<=value; ++i) fact=fact*i; printf("The factorial of %d is %d\n",value,fact); }
Absolute Variable Location http://www.keil.com/support/man/docs/ca/ca_le_absvarloc.htm
int fact __at 0x40003456 = 1;
Hi Richard , Thanks for the info
Or the generic C way -- cast the address to a pointer type: *(int*)0x40003456L = fact;