how to write a data 10 in address location 0x2000
Answers were Sorted based on User's Feedback
Answer / vishnu
int main()
{
int *ptr;
ptr = (int *)0x2000;
*ptr = 10;
printf("%d", *ptr);
}
| Is This Answer Correct ? | 5 Yes | 1 No |
The below line u can use for the question asked, provided
the address is not pointing to any OS memory, system files
or any location on ROM memory.
0x2000 is invalid address(Access voilation)in my system. So
I tried with the valid address 0x12FF70 to get the o/p.
main()
{
*(int *)(0x12FF70)= 20;
printf("%d \n",*(int *)(0x12FF70));
getch();
}
O/p would be 20.
| Is This Answer Correct ? | 1 Yes | 0 No |
Here is a good puzzle: how do you write a program which produces its own source code as output?
What is difference between Structure and Unions?
What is the symbol indicated the c-preprocessor?
why we wont use '&' sing in aceesing the string using scanf
How can I find the modification date and time of a file?
what does exit() do?
void main() {int i=2; printf("%d%d%d",i,++i,i++); getch(); }
Write a routine that prints out a 2-D array in spiral order!
Explain what is output redirection?
How to print "I Love My India" without using semi colon?
Using which language Test cases are added in .ptu file of RTRT unit testing???
Tell me can the size of an array be declared at runtime?