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 |
what is reason of your company position's in india no. 1.
write a program to display the numbers in the following format 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 4
Can we declare a function inside a function in c?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
What 'lex' does?
How can I get back to the interactive keyboard if stdin is redirected?
what is the height of tree if leaf node is at level 3. please explain
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.
There is a number and when the last digit is moved to its first position the resultant number will be 50% higher than the original number.Find the number?
Is multithreading possible in c?
What are volatile variables?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1